Download next.js/test/e2e/basepath/pages/gssp.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 401 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/basepath/pages/gssp.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/basepath/pages/gssp.js
-
curl -L -o gssp.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/basepath/pages/gssp.js
401 Bytes
| import { useRouter } from 'next/router' | |
| export const getServerSideProps = () => { | |
| return { | |
| props: { | |
| hello: 'world', | |
| random: Math.random(), | |
| }, | |
| } | |
| } | |
| export default (props) => ( | |
| <> | |
| <h3 id="gssp">getServerSideProps</h3> | |
| <p id="props">{JSON.stringify(props)}</p> | |
| <div id="pathname">{useRouter().pathname}</div> | |
| <div id="asPath">{useRouter().asPath}</div> | |
| </> | |
| ) | |