Download next.js/test/e2e/app-dir/actions/app/file/form.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 558 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/actions/app/file/form.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/actions/app/file/form.js
-
curl -L -o form.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/actions/app/file/form.js
558 Bytes
| 'use client' | |
| import { useActionState } from 'react' | |
| import { accountForOverhead } from '../../account-for-overhead' | |
| export default function Form({ action }) { | |
| const submit = (megaBytes) => | |
| action('a'.repeat(accountForOverhead(megaBytes))) | |
| const [, submit1] = useActionState(() => submit(1), undefined) | |
| const [, submit3] = useActionState(() => submit(3), undefined) | |
| return ( | |
| <> | |
| <button id="size-1mb" onClick={submit1}> | |
| 1mb | |
| </button> | |
| <button id="size-3mb" onClick={submit3}> | |
| 3mb | |
| </button> | |
| </> | |
| ) | |
| } | |