T
TanStack2y ago
adverse-sapphire

Is it intended for useQuery to read latest data when `enabled: false`?

I'd like to have useQuery calls that read w/e data is in the query cache without fetching. One useQuery call could initiate the fetch while other useQuery calls (with the same query key) read w/e data (regardless if it's stale) from the query cache. For all the other useQuery calls, is it okay for them to have enabled: false? Lmk if a code example would make this more clear. ty
1 Reply
exotic-emerald
exotic-emerald2y ago
Yes it's intended

Did you find this page helpful?