민프

[React][TypeScript] React Query- 3 ReactQueryDevTools 본문

[React]

[React][TypeScript] React Query- 3 ReactQueryDevTools

민프야 2023. 1. 28. 22:34

https://react-query-v3.tanstack.com/devtools

 

Devtools | TanStack Query Docs

Wave your hands in the air and shout hooray because React Query comes with dedicated devtools! 🥳 When you begin your React Query journey, you'll want these devtools by your side. They help visualize all of the inner workings of React Query and will like

tanstack.com

 

React Query에서 ReactQueryDevTools이라는 hook은

나의 캐시에 있는 query를 볼 수 있다. 

 

App.tsx

 import { ReactQueryDevtools } from 'react-query/devtools'
 
 function App() {
   return (
     <QueryClientProvider client={queryClient}>
       {/* The rest of your application */}
       <ReactQueryDevtools initialIsOpen={false} />
     </QueryClientProvider>
   )
 }

위 코드를 적용 시키면

react-query로 부터 온 Tool을 볼 수 있다. 

이 툴 안에서는 내 캐시에 대한 정보들을 시각화해서 볼  수 있다. 

Comments