Files
Josh StoryandGitHub 1931877c29 Remove prefetch from instant config (#92761)
prefetching is now controlled with the prefetch export and this option
is inert on the instant export. this removes the prefetch option as a
valid property on the instant config type.

also updates the ts plugin for this export and adds the definition for
the previously landed prefetch export
2026-04-17 10:44:45 -07:00

27 lines
670 B
TypeScript

import { cookies } from 'next/headers'
import { connection } from 'next/server'
export const unstable_instant = {
samples: [{ cookies: [{ name: 'auth', value: '1' }] }],
}
export const unstable_prefetch = 'force-runtime'
export default async function Page() {
const c = await cookies()
return (
<main>
<p>
This page reads cookies outside Suspense, so it should fail validation
because it would block navigation.
</p>
<div id="runtime-content">cookie: {c.get('auth')?.value}</div>
<Dynamic />
</main>
)
}
async function Dynamic() {
await connection()
return <div id="dynamic-content">Dynamic content</div>
}