React Query - React Devtools 사용하기

목차

의존성 추가

$ npm i @tanstack/react-query-devtools
# or
$ yarn add @tanstack/react-query-devtools

ReactQueryDevtools

import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import {QueryClient, QueryClientProvider } from '@tanstack/react-query'


const queryClient = new QueryClient()

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<App />
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
</React.StrictMode>,
)
Share