react-code-dataset / next.js /test /development /basic /gssp-ssr-change-reloading /pages /another /index.js
Download next.js/test/development/basic/gssp-ssr-change-reloading/pages/another/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 510 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/basic/gssp-ssr-change-reloading/pages/another/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/basic/gssp-ssr-change-reloading/pages/another/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/basic/gssp-ssr-change-reloading/pages/another/index.js
510 Bytes
| import { useRouter } from 'next/router' | |
| export default function Gsp(props) { | |
| if (useRouter().isFallback) { | |
| return 'Loading...' | |
| } | |
| return ( | |
| <> | |
| <p id="change">change me</p> | |
| <p id="props">{JSON.stringify(props)}</p> | |
| <div style={{ height: 1000, width: 50, background: 'cyan' }}></div> | |
| <p id="scroll-target">bottom</p> | |
| </> | |
| ) | |
| } | |
| export const getStaticProps = async () => { | |
| const count = 1 | |
| return { | |
| props: { | |
| count, | |
| random: Math.random(), | |
| }, | |
| } | |
| } | |