Skip to content

Commit

Permalink
fix(Table): fix error occur when table is unmounted
Browse files Browse the repository at this point in the history
  • Loading branch information
duxphp authored May 15, 2024
1 parent 64000fb commit 348aa61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/table/hooks/useRowSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function useRowSelect(

const canSelectedRows = useMemo(() => {
const currentData = reserveSelectedRowOnPaginate ? data : currentPaginateData;
return currentData.filter((row, rowIndex): boolean => !isDisabled(row, rowIndex));
return currentData?.filter((row, rowIndex): boolean => !isDisabled(row, rowIndex)) || [];
// eslint-disable-next-line
}, [reserveSelectedRowOnPaginate, data, currentPaginateData]);

Expand Down

0 comments on commit 348aa61

Please sign in to comment.