mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
The prelude is empty when the entire app is suspended during prerender. Typically this indicates a lack of suspense boundary in the app, which creates no static shell, thus throwing error. However, if the root layout itself is dynamic but wrapped under a suspense, we need special logic in this PR to detect that.
22 lines
432 B
TypeScript
22 lines
432 B
TypeScript
import { Suspense } from 'react'
|
|
import DynamicWrapper from './dynamic-wrapper'
|
|
import { SimpleWrapper } from './simple-wrapper'
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode
|
|
}) {
|
|
return (
|
|
<SimpleWrapper>
|
|
<Suspense>
|
|
<html>
|
|
<body>
|
|
<DynamicWrapper>{children}</DynamicWrapper>
|
|
</body>
|
|
</html>
|
|
</Suspense>
|
|
</SimpleWrapper>
|
|
)
|
|
}
|