From 3519e5f3ece690d0635a547ad5d96e61b427d7b1 Mon Sep 17 00:00:00 2001 From: Yevhen Martynenko Date: Tue, 14 Jan 2025 19:20:45 +0200 Subject: [PATCH] *feat upgrade react-table from 7 to 8 --- packages/ui/src/Table/Table.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/Table/Table.tsx b/packages/ui/src/Table/Table.tsx index 019ac1b6..d8be49d0 100644 --- a/packages/ui/src/Table/Table.tsx +++ b/packages/ui/src/Table/Table.tsx @@ -263,7 +263,7 @@ export const Table = ({ defaultColumn, columnResizeMode: 'onChange', paginateExpandedRows: false, - getSubRows: (row) => row.subRows as D[], + getSubRows: useCallback((row: D) => row.subRows, []), getRowCanExpand: useCallback( (row: TableRow) => { if (!getRenderRowSubComponent() && !row.subRows) { @@ -275,7 +275,7 @@ export const Table = ({ return cb(prepareRow(row)) } - return true + return row.subRows?.length > 0 }, [getCanExpand, getRenderRowSubComponent], ),