-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Query data not updated on instances of a successful query #1653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
not sure there is much we can do if you cannot reproduce it. One thing that comes to mind is that you maybe create different queryClients during render. make sure that the |
Does v3.6.1 fix your issue? |
It does! Thanks a lot for your work |
Good to hear! |
Describe the bug
QueryClient
is configured with a 1 minutestaleTime
.I mount many instances of a single query (all have the same
queryKey
) pretty much at the same time.The
useQuery
instance that triggers the network call gets to asuccess
status once the request is done but other instances are stuck in aloading
state withundefined
data.To Reproduce
I didn't manage to reproduce in a simple environment.
My
queryClient
looks like this:The hook that is mounted pretty much everywhere that shows the unexpected behaviour is the following:
Expected behavior
I'd expect to have all instances of
useAuthenticatedUser
return user data when the network query is successful.Screenshots

Desktop (please complete the following information):
Additional context
Notice the described behaviour doesn't happen every single time. Sometimes, all instances access the received data. Overall, I noticed the issue arises more often on the production build than on the development mode (I use CRA).
The text was updated successfully, but these errors were encountered: