mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
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.
26 lines
699 B
TypeScript
26 lines
699 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. Without cache components
|
|
io() is a no-op during prerendering so the entire page should be fully
|
|
static.
|
|
</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>
|
|
}
|