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], ),