Download next.js/test/e2e/app-dir/app-rendering/app/ssr-only/slow/layout.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 458 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-rendering/app/ssr-only/slow/layout.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-rendering/app/ssr-only/slow/layout.js
-
curl -L -o layout.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-rendering/app/ssr-only/slow/layout.js
458 Bytes
| import { use } from 'react' | |
| let i | |
| async function getData() { | |
| await new Promise((resolve) => setTimeout(resolve, 5000)) | |
| return { | |
| message: 'hello from slow layout', | |
| } | |
| } | |
| export default function GsspLayout(props) { | |
| // TODO-APP: refactor this test page to `async function` instead. | |
| if (!i) { | |
| i = getData() | |
| } | |
| const data = use(i) | |
| return ( | |
| <> | |
| <h1 id="slow-layout-message">{data.message}</h1> | |
| {props.children} | |
| </> | |
| ) | |
| } | |