React Query / TanStack Query: React Server State Management
Mastering queries, mutations, integration with auth, testing and more!
Created by Bonnie Schulkin | 7.5 hours on-demand video course
React Query (also called TanStack Query) has become the go-to solution for server state management in React apps, and for good reason! This smart, comprehensive solution makes it easy to keep your app up-to-date with data on the server.
In fact, if you are using Redux simply to manage data from the server, React Query can replace Redux in your app. And, for server data management, React Query is much simpler and more powerful than Redux. For example, React Query:
- tracks loading and error states for your server queries (no need to manage that yourself!)
- makes cached server data available for display while you’re fetching updated data
This course starts with a simple app to learn the basics of React Query version 3:
- queries
- loading and error states
- React Query dev tools
- pagination and pre-fetching
- mutations
Then we take a detour with the Star Wars API to learn about Infinite Queries (getting more data just as the user has gotten near the end of the current data).
What you’ll learn
- React Query queries, mutations, and cache control
- Using React Query for pagination, infinite scroll, and optimistic updates
- Integrating React Query with Authentication
- Testing React Query
Recommended Course