Skip to content

Commit

Permalink
fix(data-table): correct data-table rendering in react 18 (uber#5170)
Browse files Browse the repository at this point in the history
  • Loading branch information
chasestarr authored Sep 22, 2022
1 parent ec8a62f commit d02e6e4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/data-table/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -841,13 +841,16 @@ export function DataTable({
}
}
result.push(gridProps.width - sum(result) - scrollbarWidth);
resetAfterColumnIndex(0);
return result;
}
}
return resizedWidths;
}, [gridRef, measuredWidths, resizeDeltas, browserScrollbarWidth, rows.length, columns]);

React.useEffect(() => {
resetAfterColumnIndex(0);
}, [normalizedWidths]);

const isSelectable = batchActions ? !!batchActions.length : false;
const isSelectedAll = React.useMemo(() => {
if (!selectedRowIds) {
Expand Down Expand Up @@ -1005,7 +1008,7 @@ export function DataTable({
>
<VariableSizeGrid
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ref={setGridRef as any}
ref={(node) => setGridRef(node)}
overscanRowCount={10}
overscanColumnCount={5}
innerElementType={InnerTableElement}
Expand Down

0 comments on commit d02e6e4

Please sign in to comment.