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
Describe the bug
If two components useQuery() with the same key and render at the same time, as expected the queryFn fires once. However, the onSuccess function does not fire for both components on the first render.
Open the console then refresh the sandbox browser (for first render again)
Observe console and see one todo shown (from component one).
Click button to invalidate todo cache (or force window refetch etc)
See the onSuccess function fire for both components and console log two todos.
Expected behavior
The query should only run once to get the data as the key is the same but each use of useQuery should still fire its own onSuccess methods (I've also tried with onSettled).
Desktop (please complete the following information):
OS: OSX Catalina 10.15.3
Browser Chrome
Version Version 83.0.4103.106 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered:
Describe the bug
If two components
useQuery()
with the same key and render at the same time, as expected thequeryFn
fires once. However, theonSuccess
function does not fire for both components on the first render.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The query should only run once to get the data as the key is the same but each use of useQuery should still fire its own
onSuccess
methods (I've also tried withonSettled
).Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: