You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there! Love the library. Just reporting a "bug" (not sure it's actually a bug, but threw me off for awhile until I realized what was happening). If this is already taken care of and my problem is something else, feel free to close!
Basically, in dev mode with React Native + persistQueryClient + fast refresh turned on it seems like:
The app is wrapped in <QueryClientProvider> and hydrates the cache as expected
If a hydrated query is mounted, and you're working on the query/related code, when you save it throws away the state of the query as it unmounts and remounts
Since the cache has already been hydrated but now the query data has been thrown out, it seems like it does not grab the data from the persisted data again and just initializes as if it's empty
I'm not sure how react-query could handle this as it's just how fast refresh works, but I don't know how to do a workaround either without checking hydration/cache status a whole bunch manually which could get kind of difficult.
Thanks for the help!
Your minimal, reproducible example
None
Steps to reproduce
Sorry, I don't have time to do a minimal example right now, but I'll try to soon. Should be simple-ish to test though based on above steps?
Have a query
Persist it
Load the app and hydrate it
Modify the query code so fast refresh mounts/unmounts it
Query data is now uninitialized, doesn't re-hydrate
Expected behavior
As mentioned, I'm not sure what I'd expect, as this is kind of outside of react-query, but I'd like to know if there's a workaround in dev that doesn't involve manually ensuring that hydration has happened
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
macOS + React Native + Expo 51
Tanstack Query adapter
react-query
TanStack Query version
5.51.23
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Hey there! Love the library. Just reporting a "bug" (not sure it's actually a bug, but threw me off for awhile until I realized what was happening). If this is already taken care of and my problem is something else, feel free to close!
Basically, in dev mode with React Native + persistQueryClient + fast refresh turned on it seems like:
<QueryClientProvider>
and hydrates the cache as expectedI'm not sure how react-query could handle this as it's just how fast refresh works, but I don't know how to do a workaround either without checking hydration/cache status a whole bunch manually which could get kind of difficult.
Thanks for the help!
Your minimal, reproducible example
None
Steps to reproduce
Sorry, I don't have time to do a minimal example right now, but I'll try to soon. Should be simple-ish to test though based on above steps?
Expected behavior
As mentioned, I'm not sure what I'd expect, as this is kind of outside of react-query, but I'd like to know if there's a workaround in dev that doesn't involve manually ensuring that hydration has happened
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
macOS + React Native + Expo 51
Tanstack Query adapter
react-query
TanStack Query version
5.51.23
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: