mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
`Math.random()` is IO though it is synchronous. When `dynamicIO` is enabled we need to treat calls to `Math.random()` as IO and exclude them from prerenders unless they are cached. This change sets up the instrumentation for this behavior. Unless the sync access of async request APIs this patch does not yet have any dev warnings. These will be added in a future update when we can instrument the environment name during dev to tell the difference between the prerender phase, and render phase even without a build
14 lines
272 B
TypeScript
14 lines
272 B
TypeScript
import { Suspense } from 'react'
|
|
|
|
export default function Root({ children }: { children: React.ReactNode }) {
|
|
return (
|
|
<html>
|
|
<body>
|
|
<main>
|
|
<Suspense fallback="loading...">{children}</Suspense>
|
|
</main>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|