Replies: 1 comment 1 reply
-
I'm not sure I follow. react-query will never remove data from the cache unless its unused and garbage collected. It's the principle of stale-while-revalidate to show stale data until you get the new data. What this would do is remove the data from the screen, give you a hard loading state, and then show the data again once invalidation completes.I think what you are looking for might be |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
queryClient.invalidateQueries
can refetch active queries.{ refetchInactive: true }
will refetch immediately.what if
queryClient.invalidateQueries
clean the cache. when queries are active, they will fetch directly and not use any cache data.compare with
{ refetchInactive: true }
, this like a lazy updateBeta Was this translation helpful? Give feedback.
All reactions