Download next.js/bench/vercel/benchmark-app/app/rsc/page.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 426 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/bench/vercel/benchmark-app/app/rsc/page.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/bench/vercel/benchmark-app/app/rsc/page.js
-
curl -L -o page.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/bench/vercel/benchmark-app/app/rsc/page.js
426 Bytes
| import * as React from 'react' | |
| import { cookies } from 'next/headers' | |
| if (!('hot' in Math)) Math.hot = false | |
| export default function page() { | |
| // make the page dynamic | |
| cookies() | |
| const previous = Math.hot | |
| Math.hot = true | |
| // crash the server after responding | |
| if (process.env.CRASH_FUNCTION) { | |
| setTimeout(() => { | |
| throw new Error('crash') | |
| }, 500) | |
| } | |
| return <div>{previous ? 'HOT' : 'COLD'}</div> | |
| } | |