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
I expect the above code to not trigger queryFn because the first call is disabled, and the second has infinitely cached initialData. But queryFn ends up actually getting triggered
Describe the bug
When
useQuery
is called multiple times with the same queryKey, the behavior of enabled, initialData, and staleTime seem off.I expect the above code to not trigger
queryFn
because the first call is disabled, and the second has infinitely cached initialData. ButqueryFn
ends up actually getting triggeredYour minimal, reproducible example
https://codesandbox.io/p/sandbox/sparkling-lake-4zgjk5
Steps to reproduce
See codesandbox link
Expected behavior
I expect
query is running!
to not print to console, but it does print to consoleHow often does this bug happen?
Always
Screenshots or Videos
No response
Platform
Tanstack Query adapter
react-query
TanStack Query version
v5.62.0
TypeScript version
No response
Additional context
If the calls happen in reverse order, then everything works as I'd expect. This does not trigger
queryFn
:The text was updated successfully, but these errors were encountered: