Quest for Codev2.0.0
/
SIGN IN
next.js/test/e2e/app-dir/instant-validation/app/suspense-in-root/static/valid-client-data-does-not-block-validation/layout.tsx
layout.tsx24 lines760 B
import type { ReactNode } from 'react'
import { FetchesClientData } from './client'
import { DataCacheProvider } from '../../../../client-data-fetching-lib/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 function Layout({ children }: { children: ReactNode }) {
  return (
    <DataCacheProvider>
      <div>
        <p>
          This layout renders a client component that suspends in SSR, but it
          doesn't not block the children, so we can still validate them.
        </p>
        <FetchesClientData />
      </div>
      <hr />
      {children}
    </DataCacheProvider>
  )
}