Download next.js/test/e2e/getserversideprops/app/pages/slow/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 470 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/getserversideprops/app/pages/slow/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/getserversideprops/app/pages/slow/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/getserversideprops/app/pages/slow/index.js
470 Bytes
| import Link from 'next/link' | |
| let serverHitCount = 0 | |
| export async function getServerSideProps() { | |
| await new Promise((resolve) => setTimeout(resolve, 500)) | |
| return { | |
| props: { | |
| count: ++serverHitCount, | |
| }, | |
| } | |
| } | |
| export default ({ count }) => ( | |
| <> | |
| <p>a slow page</p> | |
| <p id="hit">hit: {count}</p> | |
| <Link href="/" id="home"> | |
| to home | |
| </Link> | |
| <br /> | |
| <Link href="/something" id="something"> | |
| to something | |
| </Link> | |
| </> | |
| ) | |