Download next.js/test/e2e/app-dir/app-basepath/app/client/page.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 867 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-basepath/app/client/page.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-basepath/app/client/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/app/client/page.js
867 Bytes
| 'use client' | |
| import { redirectAction } from './action' | |
| export default function Page() { | |
| return ( | |
| <div> | |
| <form> | |
| <button | |
| id="redirect-relative" | |
| formAction={() => redirectAction('/another')} | |
| > | |
| redirect internal with relative path | |
| </button> | |
| </form> | |
| <form> | |
| <button | |
| id="redirect-absolute-internal" | |
| formAction={() => redirectAction(location.origin + '/base/another')} | |
| > | |
| redirect internal with domain (including basePath) | |
| </button> | |
| </form> | |
| <form> | |
| <button | |
| id="redirect-absolute-external" | |
| formAction={() => | |
| redirectAction(location.origin + '/outsideBasePath') | |
| } | |
| > | |
| redirect external with domain (excluding basePath) | |
| </button> | |
| </form> | |
| </div> | |
| ) | |
| } | |