Trouble with `useInfiniteQuery()` and JSON:API- always get the initial data when loading more
getNextPageParam()
returns the correct link to the next page, but when I click the Load more
button, I just get the initial data appended to the initial data (instead of the next page data being appended). I've used tanstack query for awhile, but this is my first time using useInfiniteQuery()
so maybe I'm missing something obvious. Code and more details on SO: https://stackoverflow.com/questions/78725660/useinfinitequery-with-tanstack-query-and-jsonapi-cant-load-more-than-one-page I'd appreciate any insight you can provide.Stack Overflow
useInfiniteQuery with tanstack-query and JSON:API: can't load more ...
I have a JSON:API backend and a React app that uses tanstack-query v5.
I'm trying to use useInfiniteQuery() for paging. Based on the infinite queries docs, I came up with this code:
function
0 Replies