useInfiniteQuery pageParams always undefined
I am trying to get a useInfiniteQuery hook working by setting the pageParams to a string that i pass to our endpoint, but pageParams is always undefined.
Does pageParams need to be a number? We use a string of the next id to fetch but it doesnt set it..
6 Replies
fair-rose•3y ago
What is the value of
lastPage.nextExclusiveStartKey in the console.log?rival-blackOP•3y ago
its a stringify'd object that looks like:
fair-rose•3y ago
Odd, it should work as far as I know
conscious-sapphire•3y ago
pageParam is what you return from getNextPageParam. It can be anything
rival-blackOP•3y ago
@TkDodo 🔮 is there a reason why this would return undefined every time then given the code above?
conscious-sapphire•3y ago
Not that i can see. Show a codesandbox please