-
Why are there multiple queries with identical keys, and when does this situation arise? It appears that several components are concurrently utilizing React Query to retrieve data, and they are being re-rendered due to a common state dependency that triggers the query. Is this the likely cause of the issue? If so, what is the recommended approach for effectively managing React Query when multiple components on a page depend on it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
it cannot, keys have to be unique. if you use the same key, you use the same query. Have a look at the query devtools, they'll tell you what the keys are. |
Beta Was this translation helpful? Give feedback.
with the default staleTime of zero, every mount of a new observer will trigger a background refetch. Customize
staleTime
to reduce the amount of background refetches.