Download next.js/test/e2e/getserversideprops/app/pages/catchall/[...path].js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 754 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/getserversideprops/app/pages/catchall/%5B...path%5D.js
- Command line
-
hf download 'hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/getserversideprops/app/pages/catchall/[...path].js'
-
curl -L -o '[...path].js' https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/getserversideprops/app/pages/catchall/%5B...path%5D.js
754 Bytes
| import React from 'react' | |
| import Link from 'next/link' | |
| import { useRouter } from 'next/router' | |
| export async function getServerSideProps({ params }) { | |
| return { | |
| props: { | |
| world: 'world', | |
| params: params || {}, | |
| time: new Date().getTime(), | |
| random: Math.random(), | |
| }, | |
| } | |
| } | |
| export default ({ world, time, params, random }) => { | |
| return ( | |
| <> | |
| <p>hello: {world}</p> | |
| <span>time: {time}</span> | |
| <div id="random">{random}</div> | |
| <div id="params">{JSON.stringify(params)}</div> | |
| <div id="query">{JSON.stringify(useRouter().query)}</div> | |
| <Link href="/" id="home"> | |
| to home | |
| </Link> | |
| <br /> | |
| <Link href="/another" id="another"> | |
| to another | |
| </Link> | |
| </> | |
| ) | |
| } | |