Course lesson
Share fetched state across multiple components using React Query
React Query is smart with its caching. When you have a useQuery hook calling the same query in several places, React Query is going to already have the data pre-loaded for other components once the first one is rendered.
- Duration
- 3 min
- Access
- Included
- Transcript
- Retained from source evidence
React Query is smart with its caching. When you have a useQuery hook calling the same query in several places, React Query is going to already have the data pre-loaded for other components once the first one is rendered.
It was also fetch data again once it becomes stale.