mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This removes the `routerBfCache` and enables it automatically when `cacheComponents` is enabled. This leverages `React.Activity` on layout segments to support restoring previously visited UI segments while preserving state.
25 lines
498 B
TypeScript
25 lines
498 B
TypeScript
import { Suspense } from 'react'
|
|
import { StatefulClientComponent } from './stateful-client-component'
|
|
|
|
export default async function Page({
|
|
params,
|
|
}: {
|
|
params: Promise<{ n: string }>
|
|
}) {
|
|
const { n } = await params
|
|
return (
|
|
<>
|
|
<h2>Page {n}</h2>
|
|
<div>
|
|
<Suspense fallback={<div>Loading...</div>}>
|
|
<StatefulClientComponent n={n} />
|
|
</Suspense>
|
|
</div>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export function generateStaticParams() {
|
|
return [{ n: '1' }, { n: '2' }]
|
|
}
|