React | React-query v5(TanStack Query) 사용하기
·
React
React-query v5(TanStack Query) 설치npm i @tanstack/react-query 최상위 컴포넌트를 QueryClientProvider로 감싸줘야 함import { QueryClientProvider, QueryClient } from '@tanstack/react-query';const queryClient = new QueryClient();function App() { return ( ... );} useQuery v5에서 onSuccess, onError, onSettled 콜백들은 이제 사용되지 않음import { useQuery } from '@tanstack/react-query'const { data, error, isLoading } ..