Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit ee2c90c

Browse files
committed
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
1 parent 78804e8 commit ee2c90c

File tree

1 file changed

+34
-40
lines changed

1 file changed

+34
-40
lines changed

pages/_app.tsx

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { GrazProvider } from "graz";
33
import { AppProps } from "next/app";
44
import Script from "next/script";
55
import "nextra-theme-docs/style.css";
6-
import { ReactNode, useEffect, useState, useRef } from "react";
6+
import { ReactNode, useEffect, useRef } from "react";
77
import { WagmiConfig, createConfig } from "wagmi";
88
import { arbitrum, avalanche, mainnet, sepolia } from "wagmi/chains";
99
import * as amplitude from "@amplitude/analytics-browser";
@@ -37,10 +37,8 @@ const config = createConfig(
3737
);
3838

3939
export default function Nextra({ Component, pageProps }: NextraAppProps) {
40-
const [mounted, setMounted] = useState(false);
4140
const amplitudeInitialized = useRef(false);
4241

43-
useEffect(() => setMounted(true), []);
4442
useEffect(() => {
4543
TagManager.initialize(tagManagerArgs);
4644
}, []);
@@ -54,44 +52,40 @@ export default function Nextra({ Component, pageProps }: NextraAppProps) {
5452
}
5553
}, []);
5654

57-
// Make the global context available to every page.
5855
return (
59-
// prevent react hydration error
60-
mounted && (
61-
<>
62-
<Script
63-
async
64-
src="https://www.googletagmanager.com/gtag/js?id=G-7TVVW3MEK7"
65-
/>
66-
<Script id="google-tag">
67-
{`
68-
window.dataLayer = window.dataLayer || [];
69-
function gtag(){dataLayer.push(arguments);}
70-
gtag('js', new Date());
56+
<>
57+
<Script
58+
async
59+
src="https://www.googletagmanager.com/gtag/js?id=G-7TVVW3MEK7"
60+
/>
61+
<Script id="google-tag">
62+
{`
63+
window.dataLayer = window.dataLayer || [];
64+
function gtag(){dataLayer.push(arguments);}
65+
gtag('js', new Date());
7166
72-
gtag('config', 'G-7TVVW3MEK7');
73-
`}
74-
</Script>
75-
<AskCookbook />
76-
<GrazProvider grazOptions={{ chains: CosmosChains }}>
77-
<WagmiConfig config={config}>
78-
<ConnectKitProvider
79-
theme="midnight"
80-
customTheme={{
81-
"--ck-connectbutton-background": "#E6DAFE",
82-
"--ck-connectbutton-hover-background": "#F2ECFF",
83-
"--ck-connectbutton-color": "#141227",
84-
"--ck-font-family": "Red Hat Text, sans-serif",
85-
"--ck-connectbutton-font-size": "14px",
86-
}}
87-
>
88-
<GlobalContextProvider>
89-
<Component {...pageProps} />
90-
</GlobalContextProvider>
91-
</ConnectKitProvider>
92-
</WagmiConfig>
93-
</GrazProvider>
94-
</>
95-
)
67+
gtag('config', 'G-7TVVW3MEK7');
68+
`}
69+
</Script>
70+
<AskCookbook />
71+
<GrazProvider grazOptions={{ chains: CosmosChains }}>
72+
<WagmiConfig config={config}>
73+
<ConnectKitProvider
74+
theme="midnight"
75+
customTheme={{
76+
"--ck-connectbutton-background": "#E6DAFE",
77+
"--ck-connectbutton-hover-background": "#F2ECFF",
78+
"--ck-connectbutton-color": "#141227",
79+
"--ck-font-family": "Red Hat Text, sans-serif",
80+
"--ck-connectbutton-font-size": "14px",
81+
}}
82+
>
83+
<GlobalContextProvider>
84+
<Component {...pageProps} />
85+
</GlobalContextProvider>
86+
</ConnectKitProvider>
87+
</WagmiConfig>
88+
</GrazProvider>
89+
</>
9690
);
9791
}

0 commit comments

Comments
 (0)