silverwolf-x's picture
download
raw
447 Bytes
import { cache, use } from 'react'
export default function Layout({ children }) {
const getData = cache(() =>
fetch('https://next-data-api-endpoint.vercel.app/api/random?layout', {
next: { revalidate: 10, tags: ['thankyounext'] },
}).then((res) => res.text())
)
const dataPromise = getData()
const data = use(dataPromise)
return (
<>
<p id="layout-data">revalidate 10: {data}</p>
{children}
</>
)
}

Xet Storage Details

Size:
447 Bytes
·
Xet hash:
9dc3055c075662879609afd033bf64292ce024a17d13c0d3bfe22c07cc82267e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.