Introduction to React Query
React Query is used to work with Asynchronous data in React. It helps to fetch, cache and update data in React and React Native applications.
React Query can be added in any project using:
yarn add react-query
3 Core Concepts
3 Core concepts in React Query are:
- Query Validation
A query is used to fetch data using
Mutations are used to create/update/delete data in server. We use
Query Validation helps to check if queries are stale and potentially refetch data. We use
useQueryClient for query validation.