Skip to content

Commit

Permalink
fix: columns is NaN if conditions not met
Browse files Browse the repository at this point in the history
  • Loading branch information
Mordech committed Nov 3, 2023
1 parent 715051e commit dc0fcd8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/dynamic-grid-react/lib/components/dynamic-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export const DynamicGrid = forwardRef(

useLayoutEffect(() => {
const handleResize = () => {
if (maxColumns || dividedBy || isScroll || scrollOptions) {
setColumns(getColumns);
}
maxColumns || dividedBy || isScroll || scrollOptions
? setColumns(getColumns)
: setColumns(NaN);
};

handleResize();
Expand Down

0 comments on commit dc0fcd8

Please sign in to comment.