Files
2ed06f03e8 label as Prefetch/Prefetchable depending on prefetch config (#85076)
Tweaks the environment label logic to only use label things as
`Prefetch` if there's a runtime prefetch config. If there's none, we
label it as `Prefetchable` instead.

---------

Co-authored-by: Josh Story <[email protected]>
2025-10-20 10:34:35 -07:00

28 lines
765 B
TypeScript

import { Suspense } from 'react'
import { UncachedFetch, CachedData } from '../data-fetching'
import { PrivateCachedData } from './data-fetching'
const CACHE_KEY = '/private-cache/__LAYOUT__'
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
{children}
<section>
<h1>Layout</h1>
<p>This data is from a layout</p>
<CachedData label="layout" cacheKey={CACHE_KEY} />
<Suspense fallback="Loading private cache...">
<PrivateCachedData label="layout" cacheKey={CACHE_KEY} />
</Suspense>
<Suspense fallback="Loading uncached fetch...">
<UncachedFetch label="layout" cacheKey={CACHE_KEY} />
</Suspense>
</section>
</>
)
}