How to access cached data from React Query in a different component?
I have fetched data using useQuery in one component, and now I need access to that same data in another component that is not a child of the first component. Should I refetch the data in the second component, or is there a way to access the cached data from React Query without refetching it?
2 Replies
rising-crimson•12mo ago
you can just
useQuery
again thererising-crimson•12mo ago
React Query as a State Manager
Everything you need to know to make React Query your single source of truth state manager for your async state