mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This API has experimental modes for build validation but the dev validation is going to be stable in the next release.
24 lines
826 B
TypeScript
24 lines
826 B
TypeScript
import type { ReactNode } from 'react'
|
|
import { LazyClientWrapperWithNoSSR } from './lazy-client'
|
|
import { connection } from 'next/server'
|
|
|
|
// Make sure that the holes from this layout aren't factored in for validation
|
|
// (otherwise, we'd check a navigation into it from the root layout and fail)
|
|
export const instant = false
|
|
|
|
export default async function Layout({ children }: { children: ReactNode }) {
|
|
await connection() // Prevent the error from failing the prerender in build
|
|
return (
|
|
<>
|
|
<div>
|
|
<p>
|
|
This layout renders a component wrapped in next/dynamic with ssr:
|
|
false around the children slot. This blocks the children slot so it
|
|
prevents validation.
|
|
</p>
|
|
<LazyClientWrapperWithNoSSR>{children}</LazyClientWrapperWithNoSSR>
|
|
</div>
|
|
</>
|
|
)
|
|
}
|