Files
next.js/test/e2e/app-dir/unstable-io/fixtures/default/app/getSentinelValue.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

8 lines
200 B
TypeScript

const { PHASE_PRODUCTION_BUILD } = require('next/constants')
export function getSentinelValue() {
return process.env.NEXT_PHASE === PHASE_PRODUCTION_BUILD
? 'at buildtime'
: 'at runtime'
}