Skip to content

Commit

Permalink
feat: Wrap ScrollToTop component with Suspense for client-side rend…
Browse files Browse the repository at this point in the history
…ering
  • Loading branch information
shamimbinnur committed Jul 18, 2024
1 parent d5d55e8 commit 28c944f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions app/pomo/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import MDXsection from '@/components/common/MDXsection';
import Menu from '@/components/pomo/Menu';
import MenuBottom from '@/components/pomo/MenuBottom';
import ScrollToTop from '@/components/pomo/ScrollToTop';
import { Suspense } from 'react';

const Page = () => {
const { content, meta } = getPageContent('pomodoro.mdx');
Expand All @@ -16,9 +15,7 @@ const Page = () => {
<Menu />
<Timer />
<MenuBottom />
<Suspense>
<ScrollToTop />
</Suspense>
<ScrollToTop />
</Background>
<MDXsection meta={meta} content={content} />
</main>
Expand Down
6 changes: 4 additions & 2 deletions components/pomo/FooterNav.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from "next/link"
import {JSX} from "react"
import {JSX, Suspense} from "react"
import { HiHome } from "react-icons/hi"
import ScrollDownLink from "./ScrollDownLink"

Expand Down Expand Up @@ -32,7 +32,9 @@ const FooterNav = () => {
</li>
))}

<ScrollDownLink/>
<Suspense>
<ScrollDownLink/>
</Suspense>
</ul>
</nav>
)
Expand Down

0 comments on commit 28c944f

Please sign in to comment.