
TanStack React Query DevTools gives you a live view of the query cache while you build. Instead of guessing why a request fired twice or why a list looks outdated, you can see every query key, its status, its data and the moment it turns stale.
The tools ship as a separate package, so they never bloat your application unless you decide to include them. This article covers installation, the floating and embedded modes, the information each panel shows and how to load the tools in production when you need them.
Installing the DevTools Package
The DevTools live in their own npm package that matches the major version of the core library. Install it as a regular dependency so imports resolve in every environment, even though the component only renders during development by default.
npm install @tanstack/react-query-devtools
# or
yarn add @tanstack/react-query-devtools
pnpm add @tanstack/react-query-devtools
bun add @tanstack/react-query-devtoolsAdding the Floating Panel
Render ReactQueryDevtools inside QueryClientProvider, as close to the root as possible. A small toggle button appears in a corner of the page, and clicking it opens the panel. The component uses the nearest QueryClient automatically.
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
<QueryClientProvider client={queryClient}>
<App />
<ReactQueryDevtools initialIsOpen={false} buttonPosition="bottom-right" />
</QueryClientProvider>Useful Options
The floating mode accepts a few props for comfort. Most teams only change the starting state and the button position so it does not cover their own interface.
| Option | Purpose |
|---|---|
| initialIsOpen | Opens the panel on first load when true |
| buttonPosition | Places the toggle button in a chosen corner |
| position | Docks the opened panel to a side of the screen |
| client | Uses a specific QueryClient instead of the nearest one |
Reading the Query List
Each row in the panel represents one query key. A colored label shows whether the data is fresh, stale, fetching, paused or inactive, and a counter shows how many components observe it. Selecting a row reveals the cached data, the last update time and action buttons.
Actions Worth Knowing
- Refetch triggers the query function immediately.
- Invalidate marks the entry stale and refetches it if observed.
- Reset returns the query to its initial state.
- Remove deletes the entry from the cache.
- Trigger loading and error states to test your fallbacks.
Debugging Common Problems
The DevTools turn vague bugs into visible facts. Duplicate requests usually show up as two similar keys, such as ['user', 7] and ['user', '7']. An endless spinner often reveals a query that is disabled, which the panel labels clearly.
Checking Freshness Settings
If data refetches more than expected, watch how quickly the key changes from fresh to stale. A key that turns stale immediately is using the default staleTime of zero. The caching explanation shows how to choose better values.
Using the Embedded Panel
Some layouts work better with the tools placed inside the page, for example in a custom debug drawer. The ReactQueryDevtoolsPanel component renders the same interface without the floating button, and you control where and when it appears.
import { ReactQueryDevtoolsPanel } from '@tanstack/react-query-devtools';
export function DebugDrawer({ open }) {
return open ? <ReactQueryDevtoolsPanel /> : null;
}Development and Production Builds
By default the DevTools render only when the build runs in development mode, and bundlers remove them from production output. That keeps your shipped bundle lean without any extra configuration in most Vite, Next.js and webpack projects.
When you need to inspect a deployed build, the package provides a production entry that you can lazy load behind a flag or keyboard shortcut. Check the current TanStack documentation for the exact import path, because it can change between releases.
DevTools in Other Environments
The panel is built for web browsers. React Native apps cannot render it directly, though community plugins for mobile debugging tools exist. The React Native article covers mobile setup in more depth.
- Web apps built with Vite, Next.js or Remix work with the standard component.
- Server components cannot render the DevTools, so place them in a client component.
- Storybook and test runners usually do not need the tools.
Inspecting Mutations
Recent releases of the DevTools include a mutations view next to the query list. It shows each mutation's status, variables and result, which helps when a form submission seems to succeed but the related list does not update.
Watching a mutation and the queries it invalidates side by side reveals ordering problems quickly. If the list refetches before the server finishes saving, you will see the timing directly instead of guessing from network logs.
Team Workflows With the DevTools
Many teams keep the panel closed by default and open it only when a screen behaves unexpectedly. Sharing a screenshot of the query list in a bug report gives teammates the exact keys and states involved, which shortens debugging conversations considerably.
The panel also works as a teaching aid. New developers can watch how navigation, tab switching and form submissions move queries between states, building intuition about caching faster than reading documentation alone.
Keeping the Panel Out of the Way
Choose a button position that does not overlap your own floating actions, and remember that the panel state can persist between reloads in development. Closing it before recording demos keeps your interface clean.
Comparing DevTools With Browser Network Tools
The browser network tab shows raw requests, while React Query DevTools show why those requests happened. Using both together explains most data bugs: the network tab confirms what the server returned, and the query panel confirms which key stored it and when it became stale.
TanStack React Query DevTools FAQ
Why are the DevTools not showing?
Confirm the package is installed, the component sits inside QueryClientProvider and the app runs in development mode. Production builds exclude the tools unless you load the production entry.
Do the DevTools affect performance?
They add some work while open in development. Production users are unaffected by default because the component is removed from the bundle.
Can I use them with Next.js App Router?
Yes. Render the DevTools inside the client component that creates your QueryClientProvider.
Conclusion
TanStack React Query DevTools is the quickest way to understand what the cache is doing at any moment. Install the package, add one component and keep the panel open while you build new screens.
Pair it with the React Query tutorial to watch each concept in real time, or use it to verify the behavior of the paginated product example.



