Skip to content

Commit 415d130

Browse files
authored
docs: fix content shift in references (medusajs#13765)
1 parent ee2734c commit 415d130

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

www/apps/resources/app/references/[...slug]/page.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ export default async function ReferencesPage(props: PageProps) {
1616
const params = await props.params
1717
const { slug } = params
1818

19-
return (
20-
<Suspense fallback={<Loading />}>
21-
<div className="animate animate-fadeIn">
22-
<ReferenceMDX slug={slug} />
23-
</div>
24-
</Suspense>
25-
)
19+
return <ReferenceMDX slug={slug} />
2620
}
2721

2822
export async function generateMetadata({

www/apps/resources/components/ReferenceMDX/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
"use client"
22

3-
import { MDXClientLazy, SerializeResult } from "next-mdx-remote-client/csr"
3+
import { MDXClient, SerializeResult } from "next-mdx-remote-client/csr"
44
import MDXComponents from "../MDXComponents"
55
import { Loading, swrFetcher } from "docs-ui"
66
import useSWR from "swr"
77
import { config } from "../../config"
88
import { notFound } from "next/navigation"
9+
import { Suspense } from "react"
910

1011
type ReferenceMDXProps = {
1112
slug: string[]
@@ -29,5 +30,11 @@ export const ReferenceMDX = ({ slug }: ReferenceMDXProps) => {
2930
return notFound()
3031
}
3132

32-
return <MDXClientLazy {...serializedResult} components={MDXComponents} />
33+
return (
34+
<Suspense fallback={<Loading />}>
35+
<div className="animate animate-fadeIn">
36+
<MDXClient {...serializedResult} components={MDXComponents} />
37+
</div>
38+
</Suspense>
39+
)
3340
}

0 commit comments

Comments
 (0)