Adding React Query Devtools
When debugging our applications, we often find ourselves thinking how amazing it would be to have a way to visualize what is happening inside our application. Well, with React Query, you don’t have to worry because it has its own developer tools, or devtools.
React Query Devtools allows you to see and understand the current state of all your queries and mutations. This will save you a lot of time debugging and avoid polluting all your code with unnecessary log functions, even if temporarily.
Depending on the type of project, you can install React Query Devtools in several ways:
- If you are running npm in your project, run the following command:
npm i @tanstack/react-query-devtools
- If you are using Yarn, run the following command:
yarn add @tanstack/react-query-devtools
- If you are using pnpm, run the following command:
pnpm add @tanstack/react-query-devtools
Now, you should have React Query Devtools installed in your application...