Skip to content

Commit

Permalink
fix: override grid method in useLayoutEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Nov 18, 2024
1 parent 546be62 commit 33625f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-components/src/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
type ReactElement,
type RefAttributes,
useEffect,
useLayoutEffect,
useRef,
useState,
} from 'react';
Expand Down Expand Up @@ -36,7 +37,7 @@ function Grid<TItem = GridDefaultItem>(

const [pendingRecalculateColumnWidthsCall, setPendingRecalculateColumnWidthsCall] = useState<any[] | null>(null);

useEffect(() => {
useLayoutEffect(() => {
innerRef.current!._recalculateColumnWidths = function (...args) {
setPendingRecalculateColumnWidthsCall(args);
};
Expand Down

0 comments on commit 33625f3

Please sign in to comment.