Skip to content

Instantly share code, notes, and snippets.

@AlaBenAicha
Created October 2, 2022 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlaBenAicha/b8da3a7dcc54b113f193e0102ce1ff98 to your computer and use it in GitHub Desktop.
Save AlaBenAicha/b8da3a7dcc54b113f193e0102ce1ff98 to your computer and use it in GitHub Desktop.
// pages/_app.tsx
import React from "react";
import type { AppProps } from "next/app";
import { QueryClient, QueryClientProvider } from "react-query";
import { ReactQueryDevtools } from "react-query/devtools";
function MyApp({ Component, pageProps }: AppProps) {
const [queryClient] = React.useState(() => new QueryClient());
return (
// Provide the client to your App
<QueryClientProvider client={queryClient}>
<Component {...pageProps} />
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
);
}
export default MyApp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment