mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
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]>
25 lines
641 B
TypeScript
25 lines
641 B
TypeScript
import { Suspense } from 'react'
|
|
import { UncachedFetch, CachedFetch, CachedData } from '../data-fetching'
|
|
|
|
const CACHE_KEY = __dirname + '/__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} />
|
|
|
|
<CachedFetch label="layout" cacheKey={CACHE_KEY} />
|
|
|
|
<Suspense fallback="Loading uncached fetch...">
|
|
<UncachedFetch label="layout" cacheKey={CACHE_KEY} />
|
|
</Suspense>
|
|
</section>
|
|
</>
|
|
)
|
|
}
|