4
Fetching Data with React Query
React Query allows you to fetch, cache, and handle your server state by leveraging one of its custom hooks called useQuery. For your data to be cached, React Query has a concept called a query key. In combination with the query keys and a couple of strict defaults, React Query takes your server state management to the next level.
In this chapter, you will be introduced to the useQuery hook and understand how React Query allows you to fetch and cache your data. During this process, you will get to know all the defaults that are used in all of your queries. You will also be introduced to some options you can use to make your useQuery experience even better.
After becoming familiar with useQuery, you can start using ...
Get State Management with React Query now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.