Installing React Query
Now that you are aware of React Query, you are probably thinking, wow, I really need to add this to my project. Wait no more – here is what you need to do to install React Query.
Depending on your project type, you can install React Query in several ways.
npm
If you are running npm in your project, then this is what you need to do to install React Query.
In your terminal, run the following command:
npm i @tanstack/react-query
Yarn
If Yarn is what you prefer, then this is what you need to do to install React Query.
In your terminal, run the following command:
yarn add @tanstack/react-query
pnpm
If you are a fan of a new package manager, such as pnpm, and are using it in your project, then this is what you need to do to install React Query.
In your terminal, run the following command:
pnpm add @tanstack/react-query
Script tag
Not using a package manager? Don’t worry, because React Query can be added to...