import { cookies } from 'next/headers'
import { Suspense } from 'react'
import { cachedDelay, DebugRenderKind, uncachedIO } from '../shared'
import { connection } from 'next/server'
export default async function Layout({ children }) {
return (
Shared layout
This shared layout uses cookies and some uncached IO, so parts of it
should be runtime-prefetchable.
Loading 1... }>
{children}
)
}
async function RuntimePrefetchable() {
const cookieStore = await cookies()
const cookieValue = cookieStore.get('testCookie')?.value ?? null
await cachedDelay([__filename, cookieValue])
return (
{`Cookie from layout: ${cookieValue}`}
Loading 2... }>
)
}
async function Dynamic() {
await uncachedIO()
await connection()
return (
Dynamic content from layout
)
}