Replies: 2 comments 6 replies
-
the code above produces a sequence of events that don't go well with each other, but there are multiple ways to fix this. First, we have to understand the default settings of react-query and what the code above does:
Possible solutions, in order of usefulness:
|
Beta Was this translation helpful? Give feedback.
-
thanks for the fast reply! 🙏 but the possible solutions won't work if the first call to I'm thinking to get the keyBy data
so fetch one in the App |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say we have:
This will make re-render an infinite loop, so should I fetch one in the App and use
queryClient.getQueryData
to getusersById
?Beta Was this translation helpful? Give feedback.
All reactions