silverwolf-x's picture
download
raw
423 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 },
}).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:
423 Bytes
·
Xet hash:
efe22db76f83e2f51889ed242fd8410da779b30775d7519e1506401c041cbc4a

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