-
I am calling a lot of data from the server in chunks of 100. when the user gets to the last page, the next 100 is loaded. the problem is that when this happens, the pageIndex gets reset to zero instead of keeping it's current location. can anyone tell me what i am doing wrong here?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To answer my own question,
|
Beta Was this translation helpful? Give feedback.
To answer my own question,
autoResetPageIndex
was the culprit. I needed to add this into my code:const table = useMaterialReactTable({ columns, data, enableColumnFilters: true, autoResetPageIndex: false, onPaginationChange: setPagination, state: { isLoading, pagination, }, muiTablePaperProps: { elevation: 0, }, muiCircularProgressProps: { color: 'primary', }, enableFacetedValues: true, initialState: { showColumnFilters: true }, })