React Query: Add DevTools
9 June 2022 (Updated 9 June 2022)
Add to the root of your app where you include global providers (e.g., in a src/App.js
file):
import { ReactQueryDevtools } from 'react-query/devtools'
function App() {
return (
<QueryClientProvider client={queryClient}>
{/* The rest of your application */}
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
)
}
The component will only be included if process.env.NODE_ENV
is development
. So, you donโt need to worry about it being shown in staging / production environments.
Sources
Tagged:
React Query
Thanks for your comment ๐. Once it's approved, it will appear here.
Leave a comment