Skip to content

Commit

Permalink
refactor: Add suspense boundary around Algolia search
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Dec 6, 2024
1 parent 81f4d83 commit 79bb3e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Search from './search';
import style from './style.module.css';
import config from '../../config.json';
import { useCallback, useEffect } from 'preact/hooks';
import { Suspense } from 'preact/compat';
import ReleaseLink from './gh-version';
import Corner from './corner';
import { useOverlayToggle } from '../../lib/toggle-overlay';
Expand Down Expand Up @@ -35,7 +36,9 @@ export default function Header() {
<div class={style.outer}>
<div class={style.inner}>
<Nav class={style.nav} routes={config.nav} current={url} />
<Search />
<Suspense fallback={<span>Search</span>}>
<Search />
</Suspense>
<div class={style.social}>
<ReleaseLink class={cx(style.socialItem, style.release)} />
<SocialIcon
Expand Down

0 comments on commit 79bb3e2

Please sign in to comment.