fix(ui): исправить зависимости мемоизации таблицы
This commit is contained in:
1 parent
e7755a4d16
commit
f9a4a07996
3 files changed
+63
-59
No files matched your search
@@ -951,6 +951,8 @@ function DataGridProvider<TData extends object>({
|
||||
)
|
||||
|
||||
const tableState = table.state
|
||||
const tableLayoutKey = JSON.stringify(props.tableLayout)
|
||||
const tableClassNamesKey = JSON.stringify(props.tableClassNames)
|
||||
|
||||
// Memoize context value so consumers don't re-render during column resize.
|
||||
// Column sizing state is intentionally excluded from deps -- CSS variables
|
||||
@@ -984,10 +986,8 @@ function DataGridProvider<TData extends object>({
|
||||
props.isLoading,
|
||||
props.loadingMode,
|
||||
props.className,
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
JSON.stringify(props.tableLayout),
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
JSON.stringify(props.tableClassNames),
|
||||
tableLayoutKey,
|
||||
tableClassNamesKey,
|
||||
tableState.sorting,
|
||||
tableState.pagination,
|
||||
tableState.columnFilters,
|
||||
@@ -1112,4 +1112,4 @@ function DataGridContainer({
|
||||
)
|
||||
}
|
||||
|
||||
export { useDataGrid, DataGridProvider, DataGrid, DataGridContainer }
|
||||
export { useDataGrid, DataGridProvider, DataGrid, DataGridContainer }
|
||||
Reference in new issue
Block a user