Quest for Codev2.0.0
/
SIGN IN
next.js/test/e2e/app-dir/instant-validation/app/suspense-in-root/static/invalid-dynamic-layout-with-loading/layout.tsx
layout.tsx27 lines601 B
import { connection } from 'next/server'
import { ReactNode } from 'react'

export const unstable_instant = true

export default async function Layout({ children }: { children: ReactNode }) {
  return (
    <>
      <div>
        <p>
          This layout has a dynamic hole without a suspense. There's a
          loading.js at this level, but loading.js goes below the layout, so
          this should fail validation.
        </p>
        <Dynamic />
      </div>
      <hr />
      {children}
    </>
  )
}

async function Dynamic() {
  await connection()
  return 'Dynamic content from layout'
}