app.jsx 에서 queryClient 를 만들어주고
queryClientProvider 로 app에서 리턴하는 것 전체를 감싸주면 되는데
<QueryClientProvider client={queryClient}>
이렇게 해줘야되는걸
<QueryClientProvider queryClient={queryClient}> 이렇게 오타내서 에러가 났다 ^_T
import "./App.css";
import { InfinitePeople } from "./people/InfinitePeople";
import { InfiniteSpecies } from "./species/InfiniteSpecies";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
const queryClient = new QueryClient();
function App() {
return (
<QueryClientProvider client={queryClient}>
<div className="App">
<h1>Infinite SWAPI</h1>
<InfinitePeople />
{/* <InfiniteSpecies /> */}
<ReactQueryDevtools />
</div>
</QueryClientProvider>
);
}
export default App;
오타내지 말자!!!
댓글