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