Skip to content

Commit 12a4a7a

Browse files
1 parent 4ae14b1 commit 12a4a7a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

pages/_app.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,25 @@ import 'styles/prism-theme.css'
2121

2222
import * as React from 'react'
2323
import * as Fathom from 'fathom-client'
24+
import type { AppProps } from 'next/app'
2425
import { useRouter } from 'next/router'
2526
import { ThemeProvider } from 'next-themes'
2627
import posthog from 'posthog-js'
2728

2829
import { bootstrap } from 'lib/bootstrap-client'
29-
import { fathomId, fathomConfig, posthogId, posthogConfig } from 'lib/config'
30-
31-
if (typeof window !== 'undefined') {
30+
import {
31+
isServer,
32+
fathomId,
33+
fathomConfig,
34+
posthogId,
35+
posthogConfig
36+
} from 'lib/config'
37+
38+
if (!isServer) {
3239
bootstrap()
3340
}
3441

35-
export default function App({ Component, pageProps }) {
42+
export default function App({ Component, pageProps }: AppProps) {
3643
const router = useRouter()
3744

3845
React.useEffect(() => {

0 commit comments

Comments
 (0)