Created
October 2, 2022 15:14
-
-
Save AlaBenAicha/d0ce52c37e714820071dac68968cd96c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import type { AppProps } from "next/app"; | |
import { QueryClient, QueryClientProvider, Hydrate } from "react-query"; | |
import { ReactQueryDevtools } from "react-query/devtools"; | |
import "../styles.css"; | |
function MyApp({ Component, pageProps }: AppProps) { | |
const [queryClient] = React.useState(() => new QueryClient()); | |
return ( | |
// Provide the client to your App | |
<QueryClientProvider client={queryClient}> | |
<Hydrate state={pageProps.dehydratedState}> | |
<Component {...pageProps} /> | |
<ReactQueryDevtools initialIsOpen={false} /> | |
</Hydrate> | |
</QueryClientProvider> | |
); | |
} | |
export default MyApp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment