Describe the bug (required)
The pageIndex state property resets to 0 after loading the next page
Provide an example via Codesandbox! (required)
Use a new react-table codesandbox to reproduce the issue.
https://codesandbox.io/s/interesting-hertz-01fnh
Steps To Reproduce (required)
Steps to reproduce the behavior:
pageIndex resets back to 0Expected behavior (Recommended)
The pageIndex should not change after the data for the new page has been loaded.
Scratch my last comment...
You need to set manualSortBy to true along with manualPagination otherwise it will reset the pageIndex each time the sort state changes, you will need to handle the actual sorting in your fetchData call
You will also need to set autoResetPage to false, see https://github.com/tannerlinsley/react-table/blob/d2acfc423593389f8f7b974c6f544ecf683f0724/docs/api/usePagination.md for details
鈽濓笍 馃挴
thanks! will try that.
Most helpful comment
Scratch my last comment...
You need to set
manualSortByto true along withmanualPaginationotherwise it will reset the pageIndex each time the sort state changes, you will need to handle the actual sorting in your fetchData callYou will also need to set
autoResetPageto false, see https://github.com/tannerlinsley/react-table/blob/d2acfc423593389f8f7b974c6f544ecf683f0724/docs/api/usePagination.md for details