Download next.js/test/e2e/app-dir/actions/app/form/page.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/actions/app/form/page.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/actions/app/form/page.js
-
curl -L -o page.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/actions/app/form/page.js
1.04 kB
| import { accountForOverhead } from '../../account-for-overhead' | |
| async function action(formData) { | |
| 'use server' | |
| const payload = formData.get('payload').toString() | |
| console.log('size =', payload.length) | |
| } | |
| export default function Page() { | |
| return ( | |
| <> | |
| <form action={action}> | |
| <input | |
| type="hidden" | |
| name="payload" | |
| value={'a'.repeat(accountForOverhead(1))} | |
| /> | |
| <button type="submit" id="size-1mb"> | |
| SUBMIT 1mb | |
| </button> | |
| </form> | |
| <form action={action}> | |
| <input | |
| type="hidden" | |
| name="payload" | |
| value={'a'.repeat(accountForOverhead(2))} | |
| /> | |
| <button type="submit" id="size-2mb"> | |
| SUBMIT 2mb | |
| </button> | |
| </form> | |
| <form action={action}> | |
| <input | |
| type="hidden" | |
| name="payload" | |
| value={'a'.repeat(accountForOverhead(3))} | |
| /> | |
| <button type="submit" id="size-3mb"> | |
| SUBMIT 3mb | |
| </button> | |
| </form> | |
| </> | |
| ) | |
| } | |