Skip to content

Commit

Permalink
Merge pull request #351 from Renumics/fix/autosizer-types
Browse files Browse the repository at this point in the history
chore: explictly type autosizer size
  • Loading branch information
druzsan authored Nov 10, 2023
2 parents e98bae7 + 17524e0 commit 0b5a010
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/widgets/DataGrid/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'twin.macro';
import TableIcon from '../../icons/Table';
import { Widget } from '../types';
import { useCallback, useMemo, useRef } from 'react';
import AutoSizer from 'react-virtualized-auto-sizer';
import AutoSizer, { type Size } from 'react-virtualized-auto-sizer';
import { VariableSizeGrid as Grid } from 'react-window';
import { Dataset, Sorting, useDataset } from '../../stores/dataset';
import { DataColumn, TableView } from '../../types';
Expand Down Expand Up @@ -87,7 +87,7 @@ const DataGrid: Widget = () => {
<MenuBar />
<WidgetContent>
<AutoSizer>
{({ width, height }) => (
{({ width, height }: Size) => (
<div tw="bg-white" style={{ width, height }}>
<GridContextMenu>
<div tw="bg-gray-100 w-full">
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/Inspector/Inspector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'twin.macro';
import DetailsIcon from '../../icons/ClipboardList';
import AutoSizer from 'react-virtualized-auto-sizer';
import AutoSizer, { type Size } from 'react-virtualized-auto-sizer';
import { Widget } from '../types';
import useWidgetConfig from '../useWidgetConfig';
import DetailsGrid, { COLUMN_COUNT_OPTIONS } from './DetailsGrid';
Expand Down Expand Up @@ -54,7 +54,7 @@ const Inspector: Widget = () => {
<WidgetContent>
<DropZone />
<AutoSizer>
{({ width, height }) => (
{({ width, height }: Size) => (
<DetailsGrid
width={width}
height={height}
Expand Down

0 comments on commit 0b5a010

Please sign in to comment.