Download next.js/test/development/basic/gssp-ssr-change-reloading/pages/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 445 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/basic/gssp-ssr-change-reloading/pages/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/basic/gssp-ssr-change-reloading/pages/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/index.js
445 Bytes
| import { useRouter } from 'next/router' | |
| import data from '../lib/data.json' | |
| export default function Gsp(props) { | |
| if (useRouter().isFallback) { | |
| return 'Loading...' | |
| } | |
| return ( | |
| <> | |
| <p id="change">change me</p> | |
| <p id="props">{JSON.stringify(props)}</p> | |
| </> | |
| ) | |
| } | |
| export const getStaticProps = async () => { | |
| const count = 1 | |
| return { | |
| props: { | |
| count, | |
| data, | |
| random: Math.random(), | |
| }, | |
| } | |
| } | |