Skip to content

Commit

Permalink
*feat upgrade react-table from 7 to 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Sodik committed Jan 14, 2025
1 parent 50981a9 commit 3519e5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ui/src/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export const Table = <D extends RowData & { subRows?: D[] }>({
defaultColumn,
columnResizeMode: 'onChange',
paginateExpandedRows: false,
getSubRows: (row) => row.subRows as D[],
getSubRows: useCallback((row: D) => row.subRows, []),
getRowCanExpand: useCallback(
(row: TableRow<D>) => {
if (!getRenderRowSubComponent() && !row.subRows) {
Expand All @@ -275,7 +275,7 @@ export const Table = <D extends RowData & { subRows?: D[] }>({
return cb(prepareRow(row))
}

return true
return row.subRows?.length > 0
},
[getCanExpand, getRenderRowSubComponent],
),
Expand Down

0 comments on commit 3519e5f

Please sign in to comment.