Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't disable SSR everywhere because hashlinks stop working (although…
… they would probably still work in static builds).
  • Loading branch information
WebsByTodd committed Jul 15, 2024
commit b1cf35a27eb598a6ed46ec35b080a410ae5232c0
11 changes: 9 additions & 2 deletions next/src/components/Navigation/NavGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ import { lora, spectral } from '@/lib/fonts'
import { useInitialValue } from '@/lib/useInitialValue'
import clsx from 'clsx/lite'
import { AnimatePresence, motion } from 'framer-motion'
import dynamic from 'next/dynamic'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { useState } from 'react'
import { ActivePageMarker } from './ActivePageMarker'
import { NavigationGroup } from './config'
import NavLink from './NavLink'
import { VisibleSectionHighlight } from './VisibleSectionHighlight'

const VisibleSectionHighlight = dynamic(
() =>
import('./VisibleSectionHighlight').then(
(module) => module.VisibleSectionHighlight,
),
{ ssr: false },
)

interface NavGroupProps {
group: NavigationGroup
Expand Down
8 changes: 1 addition & 7 deletions next/src/pages/_app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Layout } from '@/components/Layout'
import * as mdxComponents from '@/components/mdx'
import { useMobileNavigationStore } from '@/components/MobileNavigation'
import { MDXProvider } from '@mdx-js/react'
import dynamic from 'next/dynamic'
import Head from 'next/head'
import { Router } from 'next/router'

Expand All @@ -16,7 +15,7 @@ function onRouteChange() {
Router.events.on('routeChangeStart', onRouteChange)
Router.events.on('hashChangeStart', onRouteChange)

function App({ Component, pageProps }) {
export default function App({ Component, pageProps }) {
return (
<>
<Head>
Expand All @@ -31,8 +30,3 @@ function App({ Component, pageProps }) {
</>
)
}

// Disable SSR everywhere so we can use the document object normally
export default dynamic(() => Promise.resolve(App), {
ssr: false,
})