Created
April 6, 2023 15:41
-
-
Save SKumarSpace/31981f31da3c19842bda2912e98986cb to your computer and use it in GitHub Desktop.
Next.js - Disable SSR
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 "../styles/globals.css"; | |
import { LocalAppProps } from "../interfaces"; | |
import ErrorBoundary from "../components/ErrorBoundary"; | |
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; | |
import Controller from "../components/Controller"; | |
const queryClient = new QueryClient(); | |
export default function MyApp({ Component, pageProps }: LocalAppProps) { | |
return ( | |
<div suppressHydrationWarning> | |
{typeof window === "undefined" ? null : ( | |
<ErrorBoundary> | |
<QueryClientProvider client={queryClient}> | |
<Controller Component={Component} pageProps={pageProps} /> | |
</QueryClientProvider> | |
</ErrorBoundary> | |
)} | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment