Files
Josh StoryandGitHub 766b7cbff4 Stabilize unstable_io (#93621)
Removes the unstable prefix from `unstable_io`. Since this was only
shipped in canaries with the unstable prefix we are going to just remove
it without retaining the unstable prefix simultaneously.
2026-05-07 16:39:37 -07:00

26 lines
720 B
TypeScript

import { Suspense } from 'react'
import { io } from 'next/cache'
import { getSentinelValue } from '../getSentinelValue'
export default function Page() {
return (
<>
<p>
This page uses io() inside a Suspense boundary. With cache components
the content after io() should be dynamic and rendered at request time,
not during the build prerender.
</p>
<div id="before">{getSentinelValue()}</div>
<Suspense fallback={<div id="fallback">loading...</div>}>
<DynamicComponent />
</Suspense>
<div id="page">{getSentinelValue()}</div>
</>
)
}
async function DynamicComponent() {
await io()
return <div id="after-io">{getSentinelValue()}</div>
}