infinite scroll network 200 but undefined
I'm trying to implement infinite scrolling of chat content.
The data result is 200. If you check the preview, you will see the following.
However, when outputting to console.log, undefined is displayed. What's the problem?
"react-query": "^3.39.3",


6 Replies
optimistic-gold•2y ago
code looks fine, put it in a codesandbox then I can help debug it
oh, why are you using
react-query
and not @tanstack/react-query
?magic-beige•2y ago
Also devtools can help 🙂
provincial-silverOP•2y ago
I wanted to use tanstack-query, but my team members refused because they had not used it before...
This is Code Sandbox. But since this is my first time using it, I'm not sure if it works...
Thank you so much for your help.
https://codesandbox.io/p/sandbox/autumn-monad-xcj38v?file=%2Fsrc%2FApp.js%3A42%2C1
optimistic-gold•2y ago
tanstack query is just the next major version of react-query. It's the same library...
provincial-silverOP•2y ago
Of course I know! I am using it in my personal project. But... the project team members wanted v3. I also don't understand the other team members...
optimistic-gold•2y ago
what always helps is adding the devtools, then you can see that the query goes into error state because of
so it's this line:
not sure where
Cookies
is coming from but this doesn't work
here's a fork of you sandbox with added devtools: https://codesandbox.io/p/sandbox/autumn-monad-forked-2x78gc?file=%2Fsrc%2FApp.js%3A11%2C22