Is array in query key array compared by value or reference? useQuery, v3
Would the following query key be the same?
Thank you!
3 Replies
unwilling-turquoise•3y ago
Yes
exotic-emeraldOP•3y ago
@TkDodo 🔮 Thank you!
@TkDodo 🔮
https://codesandbox.io/s/hardcore-worker-t308yo?file=/src/index.js
Do you know why using queryB would also update data of queryA?
exotic-emeraldOP•3y ago
Actually I found the answer, I should pass
exact:true for my case, https://tanstack.com/query/v3/docs/react/guides/filtersFilters | TanStack Query Docs
Some methods within React Query accept a QueryFilters or MutationFilters object.
Query Filters