mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Reverts the revert of #95878. This failed on `main` due to React bugs (https://github.com/react/react/pull/37061?) which are fixed now.
24 lines
458 B
TypeScript
24 lines
458 B
TypeScript
import { notFound } from 'next/navigation'
|
|
import { Suspense } from 'react'
|
|
|
|
async function Content({ params }: { params: Promise<{ slug: string }> }) {
|
|
const { slug } = await params
|
|
if (slug === '404') {
|
|
notFound()
|
|
}
|
|
|
|
return <p id="dynamic">Dynamic page: {slug}</p>
|
|
}
|
|
|
|
export default function DynamicPage({
|
|
params,
|
|
}: {
|
|
params: Promise<{ slug: string }>
|
|
}) {
|
|
return (
|
|
<Suspense>
|
|
<Content params={params} />
|
|
</Suspense>
|
|
)
|
|
}
|