From ee2c90c791ce579568d94e934e68859205f1d463 Mon Sep 17 00:00:00 2001 From: Connor Prussin Date: Tue, 18 Feb 2025 12:05:12 -0800 Subject: [PATCH] fix: re-enable SSR To be quite honest, I'm not sure if this is safe or what it might break (or why this was ever done in the first place). However, having SSR disabled is causing some docs pages to have terrible performance and people are complaining. I did some testing with this and I didn't see any issues. At this point I believe the best path forward is to re-enable SSR and just fix forward if we find any issues I missed --- pages/_app.tsx | 74 +++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 40 deletions(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index 7c1875f3..6992fcf6 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -3,7 +3,7 @@ import { GrazProvider } from "graz"; import { AppProps } from "next/app"; import Script from "next/script"; import "nextra-theme-docs/style.css"; -import { ReactNode, useEffect, useState, useRef } from "react"; +import { ReactNode, useEffect, useRef } from "react"; import { WagmiConfig, createConfig } from "wagmi"; import { arbitrum, avalanche, mainnet, sepolia } from "wagmi/chains"; import * as amplitude from "@amplitude/analytics-browser"; @@ -37,10 +37,8 @@ const config = createConfig( ); export default function Nextra({ Component, pageProps }: NextraAppProps) { - const [mounted, setMounted] = useState(false); const amplitudeInitialized = useRef(false); - useEffect(() => setMounted(true), []); useEffect(() => { TagManager.initialize(tagManagerArgs); }, []); @@ -54,44 +52,40 @@ export default function Nextra({ Component, pageProps }: NextraAppProps) { } }, []); - // Make the global context available to every page. return ( - // prevent react hydration error - mounted && ( - <> - - - - - - - - - - - - - ) + gtag('config', 'G-7TVVW3MEK7'); + `} + + + + + + + + + + + + ); }