From 348aa6185045d980d6f1176788f4d882f0934cc0 Mon Sep 17 00:00:00 2001 From: "Mr.L" Date: Wed, 15 May 2024 11:44:30 +0800 Subject: [PATCH] fix(Table): fix error occur when table is unmounted --- src/table/hooks/useRowSelect.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/table/hooks/useRowSelect.tsx b/src/table/hooks/useRowSelect.tsx index 6e3a34ca2a..94db1f483f 100644 --- a/src/table/hooks/useRowSelect.tsx +++ b/src/table/hooks/useRowSelect.tsx @@ -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]);