Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The issue with the update of nextPageParams when using useInfiniteQuery is that it can cause unexpected behavior in the pagination. Specifically, if nextPageParams is updated before the query for the current page is complete, it can cause the pagination to skip over pages, resulting in missing or duplicated data. To prevent this, it is important to ensure that nextPageParams is only updated after the current page query is complete. One way to do this is to use the onSuccess callback provided by useInfiniteQuery to update nextPageParams after the data for the current page has been fetched.