The behavior of queryFn performed by invalidateQueries
and refetch
are slightly different.
#6955
Unanswered
ynifamily3
asked this question in
Q&A
Replies: 2 comments
-
your example closes over a value you need:
|
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
Uh oh!
There was an error while loading. Please reload this page.
-
If you change the value of the 'v' count by pressing the button a few times and clicks 'invalidate', the old value will be displayed on the console. 'refetch' prints new value to the console.
I think 'invalidate' is a closure issue because it holds a reference to an old function. Is this the intended behavior? Is there a way to make it look at the new function reference rather than using the old closure value?
Beta Was this translation helpful? Give feedback.
All reactions