Download next.js/test/production/standalone-mode/basic/pages/hello.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 343 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/standalone-mode/basic/pages/hello.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/production/standalone-mode/basic/pages/hello.js
-
curl -L -o hello.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/standalone-mode/basic/pages/hello.js
343 Bytes
| import useSWR, { useSWRConfig } from 'swr' | |
| export default function Page({ foo }) { | |
| const { data } = useSWR('hello', (v) => v, { fallbackData: 'hello' }) | |
| useSWRConfig() // call SWR context | |
| return <div id="content">{`${data}-${foo}`}</div> | |
| } | |
| export function getServerSideProps() { | |
| return { | |
| props: { | |
| foo: 'bar', | |
| }, | |
| } | |
| } | |