Skip to content

Commit a72656e

Browse files
committed
chore: move Codeblock & CodeModal declarations outside of main component
1 parent 7c51ae6 commit a72656e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/pages/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,14 @@ export const getStaticProps = (async ({ locale }) => {
219219
}
220220
}) satisfies GetStaticProps<Props>
221221

222+
// Lazy-load these components on initial load
223+
const Codeblock = dynamic(() => import("@/components/Codeblock"), {
224+
ssr: false,
225+
})
226+
const CodeModal = dynamic(() => import("@/components/CodeModal"), {
227+
ssr: false,
228+
})
229+
222230
const HomePage = ({
223231
communityEvents,
224232
metricResults,
@@ -331,14 +339,6 @@ const HomePage = ({
331339

332340
const cardBoxShadow = useToken("colors", "cardBoxShadow")
333341

334-
// Lazy-load these components on initial load
335-
const Codeblock = dynamic(() => import("@/components/Codeblock"), {
336-
ssr: false,
337-
})
338-
const CodeModal = dynamic(() => import("@/components/CodeModal"), {
339-
ssr: false,
340-
})
341-
342342
return (
343343
<Flex
344344
as={MainArticle}

0 commit comments

Comments
 (0)