react-code-dataset / next.js /test /development /pages-dir /client-navigation /fixture /pages /nav /query-params.js
Download next.js/test/development/pages-dir/client-navigation/fixture/pages/nav/query-params.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 911 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/pages-dir/client-navigation/fixture/pages/nav/query-params.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/pages-dir/client-navigation/fixture/pages/nav/query-params.js
-
curl -L -o query-params.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/pages-dir/client-navigation/fixture/pages/nav/query-params.js
911 Bytes
| import { useRouter } from 'next/router' | |
| export default function Page() { | |
| const router = useRouter() | |
| return ( | |
| <> | |
| <button | |
| id="click-me" | |
| onClick={() => | |
| router.push({ | |
| pathname: '/query', | |
| query: { | |
| param1: '', | |
| param2: undefined, | |
| param3: null, | |
| param4: 0, | |
| param5: false, | |
| param6: [], | |
| param7: {}, | |
| param8: NaN, | |
| param9: new Date(1234), | |
| param10: /hello/, | |
| param11: [ | |
| '', | |
| undefined, | |
| null, | |
| 0, | |
| false, | |
| [], | |
| {}, | |
| NaN, | |
| new Date(1234), | |
| /hello/, | |
| ], | |
| }, | |
| }) | |
| } | |
| > | |
| Click me | |
| </button> | |
| </> | |
| ) | |
| } | |