Quest for Codev2.0.0
/
SIGN IN
next.js/test/e2e/app-dir/instant-validation/app/suspense-in-root/static/invalid-csr-bailout-blocks-children/layout.tsx
layout.tsx24 lines835 B
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 unstable_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>
    </>
  )
}