Download next.js/test/e2e/app-dir/app-prefetch/app/revalidate-0/layout.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 384 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-prefetch/app/revalidate-0/layout.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-prefetch/app/revalidate-0/layout.js
-
curl -L -o layout.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-prefetch/app/revalidate-0/layout.js
384 Bytes
| import React from 'react' | |
| export const revalidate = 0 | |
| export default async function Layout({ children }) { | |
| console.log('re-fetching in layout') | |
| const data = await fetch( | |
| 'https://next-data-api-endpoint.vercel.app/api/random' | |
| ) | |
| const randomNumber = await data.text() | |
| return ( | |
| <div> | |
| <p id="random-number">{randomNumber}</p> | |
| {children} | |
| </div> | |
| ) | |
| } | |