react-code-dataset / next.js /test /e2e /app-dir /app-basepath-custom-server /custom-server /app /page.js
Download next.js/test/e2e/app-dir/app-basepath-custom-server/custom-server/app/page.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 432 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-basepath-custom-server/custom-server/app/page.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-basepath-custom-server/custom-server/app/page.js
-
curl -L -o page.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-basepath-custom-server/custom-server/app/page.js
432 Bytes
| import { redirect } from 'next/navigation' | |
| import { cookies } from 'next/headers' | |
| async function action() { | |
| 'use server' | |
| ;(await cookies()).set( | |
| 'custom-server-action-test-cookie', | |
| 'custom-server-action-test-cookie-val' | |
| ) | |
| redirect('/another') | |
| } | |
| export default function Page() { | |
| return ( | |
| <form action={action}> | |
| <input type="submit" value="Submit" id="submit-server-action-redirect" /> | |
| </form> | |
| ) | |
| } | |