Replies: 1 comment 5 replies
-
It does, but using enabled: false + refetch bypasses that and takes you into "imperative fetching" mode. Calling refetch will refetch every time. why are you working with disabled queries? Usually, there are other ways to solve problems that are more idiomatic for react-query. |
Beta Was this translation helpful? Give feedback.
5 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I've a query with these options:
but if I call
refetch()
before 5 minutes (expected stateTime) I see new API call inDevTools -> Network
and react-query doesn't retrieve data from cache!Therefore I created this helper function:
Actually my code works well, but I've doubt on this scenario which is best practice or not?
I thought react-query supports cache retrieval by default with
staleTime
andcacheTime
but apparently it's not correct...Do you have any idea?
Beta Was this translation helpful? Give feedback.
All reactions