docs: fix content shift in references (#13765)

This commit is contained in:
Shahed Nasser
2025-10-17 08:12:15 +03:00
committed by GitHub
parent ee2734c23d
commit 415d13091d
2 changed files with 10 additions and 9 deletions

View File

@@ -16,13 +16,7 @@ export default async function ReferencesPage(props: PageProps) {
const params = await props.params
const { slug } = params
return (
<Suspense fallback={<Loading />}>
<div className="animate animate-fadeIn">
<ReferenceMDX slug={slug} />
</div>
</Suspense>
)
return <ReferenceMDX slug={slug} />
}
export async function generateMetadata({

View File

@@ -1,11 +1,12 @@
"use client"
import { MDXClientLazy, SerializeResult } from "next-mdx-remote-client/csr"
import { MDXClient, SerializeResult } from "next-mdx-remote-client/csr"
import MDXComponents from "../MDXComponents"
import { Loading, swrFetcher } from "docs-ui"
import useSWR from "swr"
import { config } from "../../config"
import { notFound } from "next/navigation"
import { Suspense } from "react"
type ReferenceMDXProps = {
slug: string[]
@@ -29,5 +30,11 @@ export const ReferenceMDX = ({ slug }: ReferenceMDXProps) => {
return notFound()
}
return <MDXClientLazy {...serializedResult} components={MDXComponents} />
return (
<Suspense fallback={<Loading />}>
<div className="animate animate-fadeIn">
<MDXClient {...serializedResult} components={MDXComponents} />
</div>
</Suspense>
)
}