Files
next.js/test/e2e/app-dir/unstable-io/fixtures/cache-components/pages/pages-gssp.tsx
Josh StoryandGitHub e22dc27d8f Add experimental unstable_io() API behind experimental.unstableIO flag (#92521)
Adds a new export from next/cache that acts as a metasyntactic IO
boundary. During prerendering with cache components it returns a hanging
promise to prevent execution of code that follows it. In all other
contexts it resolves as a fulfilled thenable that React can unwrap
synchronously. This is gated behind experimental.unstableIO and not
ready for general use.
2026-04-08 13:09:53 -07:00

16 lines
367 B
TypeScript

import { unstable_io } from 'next/cache'
export default function PagesGSSP({ rendered }: { rendered: string }) {
return (
<>
<p>This page uses unstable_io() in getServerSideProps.</p>
<div id="pages-content">{rendered}</div>
</>
)
}
export async function getServerSideProps() {
await unstable_io()
return { props: { rendered: 'ok' } }
}