Files
Josh StoryandGitHub adb2913661 Stabilize export const prefetch (#94571)
This API is going to ship stable but some options may individually be
marked unstable
2026-06-08 18:30:55 -07:00

26 lines
747 B
TypeScript

import { Suspense } from 'react'
type Params = { id: string }
// No per-segment `prefetch`. The route's prefetch config comes from
// the global `partialPrefetching: 'unstable_eager'` in next.config, which makes
// it eager — so the App Shells skip does NOT apply.
export function generateStaticParams() {
return [{ id: '1' }, { id: '2' }, { id: '3' }]
}
export default function Page({ params }: { params: Promise<Params> }) {
return (
<main>
<Suspense fallback={<p id="shell">App shell</p>}>
<ParamContent params={params} />
</Suspense>
</main>
)
}
async function ParamContent({ params }: { params: Promise<Params> }) {
const { id } = await params
return <p id="param-value">{`Eager post ${id}`}</p>
}