All useQuery data is undefined...
Hi all, a bit of a weird error, but all of my useQuery data is undefined. I'm using axios, react-query v3, and I'm using react query (same version) on two projects. One project, is works just fine, the other one, every query is undefined. When I set the res.data to a variable on the bugged project, I can see the data no problem. In my other project, it works no problem as intended.
The queries all return successes as well, they all load, return a 200 success, and become stale right on schedule. What on earth could be happening here?
6 Replies
stormy-goldOP•3y ago
update, migrated the project to react-query v4
all data is still null
(i guess its now null instead of undefined?)
rare-sapphire•3y ago
Hi an unstable queryclient ? Could you show a reproduction ?
stormy-goldOP•3y ago
I'm not sure what you mean reproduction, could you specify?
rare-sapphire•3y ago
A codesandbox with a reproduction of the problem. It is easier to help with some code to read 😅
And by setting up a reproduction the solution may show up by its own
fascinating-indigo•3y ago
it really does sound like:
- https://tkdodo.eu/blog/react-query-fa-qs#2-the-queryclient-is-not-stable
React Query FAQs
Answering the most frequently asked React Query questions
stormy-goldOP•3y ago
Thank you for this, I’ll look into it. Your blog is legendary and helped a lot when I was first learning the library! Cheers!