Skip to content

Commit

Permalink
Lazy load nav
Browse files Browse the repository at this point in the history
  • Loading branch information
muliswilliam committed Sep 24, 2023
1 parent c345655 commit 2aadf4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface Props {
showDashboardMenu?: boolean
}

export function MainNav({ className, showDashboardMenu }: Props) {
export default function MainNav({ className, showDashboardMenu }: Props) {
// hooks
const { userId } = useAuth()
const router = useRouter()
Expand Down
3 changes: 2 additions & 1 deletion src/layouts/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import { MainNav } from '@/components/nav'
import dynamic from 'next/dynamic'
const MainNav = dynamic(() => import('@/components/nav'), { ssr: false })
import { AppHead } from '../components/Head'
import { ContentWrapper } from './content-wrapper'

Expand Down

0 comments on commit 2aadf4b

Please sign in to comment.