Closed pk111and222 closed 2 months ago
since data is an array, remember to spread the new data with ...
https://react.dev/learn/updating-arrays-in-state
since data is an array, remember to spread the new data with
...
https://react.dev/learn/updating-arrays-in-state
I'm sorry, I didn't understand the meaning here. I tried to make some changes and found that the page got stuck when switching.
const table = useReactTable({
data: [...data],
columns,
onPaginationChange: setPagination,
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel(),
onSortingChange: setSorting,
getSortedRowModel: getSortedRowModel(),
onColumnFiltersChange: setColumnFilters,
onRowSelectionChange: setRowSelection,
getFilteredRowModel: getFilteredRowModel(),
autoResetPageIndex: !skipPageResetRef.current,
autoResetExpanded: !skipPageResetRef.current,
rowCount: total,
debugTable: true,
state: {
pagination,
sorting,
columnFilters,
rowSelection,
}
})
I can confirm that the props data passed into the component is unchanged.So where does this infinite loop happen?
TanStack Table version
8.20.1
Framework/Library version
"next": "14.1.0","react": "^18"
Describe the bug and the steps to reproduce it
this demo in the getData perform page turning behavior . list is It was executed and set successfully, but the table was not re-rendered. so ,i dont know why
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
sorry, i didnt created some data
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
No, because I do not know how
Terms & Code of Conduct