Skip to content

Commit 090e6e8

Browse files
committed
Check if column and row count is positive
1 parent d1fd012 commit 090e6e8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/react-native-sortables/src/components/SortableGrid.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ function SortableGrid<I>(props: SortableGridProps<I>) {
6464
if (!isVertical && !rowHeight) {
6565
throw error('rowHeight is required for horizontal Sortable.Grid');
6666
}
67+
if (columns !== undefined && columns < 1) {
68+
throw error('columns must be greater than 0');
69+
}
70+
if (rows !== undefined && rows < 1) {
71+
throw error('rows must be greater than 0');
72+
}
6773

6874
const columnGapValue = useAnimatableValue(columnGap);
6975
const rowGapValue = useAnimatableValue(rowGap);

0 commit comments

Comments
 (0)