Skip to content

Instantly share code, notes, and snippets.

@SKumarSpace
Created April 6, 2023 15:41
Show Gist options
  • Save SKumarSpace/31981f31da3c19842bda2912e98986cb to your computer and use it in GitHub Desktop.
Save SKumarSpace/31981f31da3c19842bda2912e98986cb to your computer and use it in GitHub Desktop.
Next.js - Disable SSR
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