automatic refetching only on key change (no refetch of stale data) #8306
Unanswered
dominikdosoudil
asked this question in
Q&A
Replies: 2 comments
-
Funny because I’ve just implicitly addressed it in this PR: I used to make a fix that said that disabled queries shouldn’t be shown as |
Beta Was this translation helpful? Give feedback.
0 replies
-
@TkDodo Wow, that's cool. I believe this would be really helpful in my scenario. Thanks However I will still be unable to acquire the behaviour "Refetch on key change, do not refetch when it becomes stale" am I right? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Use case:
The idea:
{query.isStale ? <button ... /> : null}
Unfortunately I expected that isStale would still change even if the query is disabled but it does not. Refetching the disabled query works tho. Is there a way how to make it work?
@tanstack/[email protected]
Code snippets with my configuration:
EDIT:
Actually, changing page won't work as well. I've got confused while trying different options.
Anyway, I guess that I need something like:
refetchOnStale: false
but I couldn't found anything like that in the docs.Beta Was this translation helpful? Give feedback.
All reactions