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
To Reproduce
Steps to reproduce the behavior:
I am using react-query v.3.16.0 with react-router-dom. I am having an issue when I navigate from a component with a sibling component using match params.
For example I have a page with a list of Football Leagues (Leagues component in code sandbox) When I go to this page and navigate to an individual league if you check the console you can see that the useQuery gets recalled in the Leagues component gets called again, although it shouldn't as this component has unmounted and the individual League component is visible.
See codesanbox here which will demonstrate the problem more clearly.
Expected behavior
I would expect when I navigate to a component (League) that is not the component (Leagues) where the useQuery exists that that query should not be called again before navigating away from that component.