How does TanStack Query work?
TanStack query has ‘useQuery’ hook at its core which provides data fetching and caching. It behind the scene takes the data and stores its and serves it when needed, managing cache intelligently. Let’s understand it better while working on it.
Caching Data with React Query and Hooks
If you have integrated Apis in your React js website, then you know that whenever a page is refreshed the data is re-fetched every time whether you have used useEffect to fetch data on the component mount or used some custom functions to fetch data. This results in unnecessary requests and decreased performance. For that situation, caching is a very good option so in this article, we’ll see how to cache that data using React Query which is now known as TanStack Query.
Table of Content
- What will we do?
- What is React Query/TanStack Query?
- How does TanStack Query work?
- Conclusion
- FAQs
Contact Us