Quest for Codev2.0.0
/
SIGN IN
next.js/test/e2e/app-dir/instant-validation/app/suspense-in-root/runtime/valid-sync-io-in-layout-generate-metadata-static-page/layout.tsx
layout.tsx19 lines523 B
import { cookies } from 'next/headers'

// This layout does NOT have runtime prefetch and neither does the child
// page. Since no segment has runtime prefetch enabled, sync IO in
// generateMetadata should be allowed.
export const unstable_instant = true

export async function generateMetadata() {
  await cookies()
  const now = Date.now()
  return {
    title: `Layout metadata with sync IO: ${now}`,
  }
}

export default function Layout({ children }: { children: React.ReactNode }) {
  return <div>{children}</div>
}