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

24 lines
643 B
TypeScript

import { Suspense } from 'react'
import { connection } from 'next/server'
// Opts this route into partial prefetching at the segment level, without the
// global `partialPrefetching` flag. A `prefetch={true}` link should prefetch
// the static shell but never the dynamic data.
export const prefetch = 'partial'
export default function Page() {
return (
<main>
<div id="static-content">Partial static</div>
<Suspense fallback={<div>Loading dynamic...</div>}>
<Dynamic />
</Suspense>
</main>
)
}
async function Dynamic() {
await connection()
return <div id="dynamic-content">Partial dynamic</div>
}