react-code-dataset / next.js /test /development /pages-dir /client-navigation /fixture /pages /nav /querystring.js
Download next.js/test/development/pages-dir/client-navigation/fixture/pages/nav/querystring.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 603 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/pages-dir/client-navigation/fixture/pages/nav/querystring.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/pages-dir/client-navigation/fixture/pages/nav/querystring.js
-
curl -L -o querystring.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/pages-dir/client-navigation/fixture/pages/nav/querystring.js
603 Bytes
| import React from 'react' | |
| import Link from 'next/link' | |
| export default class AsyncProps extends React.Component { | |
| static async getInitialProps({ query: { id = 0 } }) { | |
| return { id } | |
| } | |
| render() { | |
| return ( | |
| <div className="nav-querystring"> | |
| <Link | |
| href={`/nav/querystring?id=${parseInt(this.props.id) + 1}`} | |
| id="next-id-link" | |
| > | |
| Click here | |
| </Link> | |
| <Link href="/nav/querystring" id="main-page"> | |
| Click here | |
| </Link> | |
| <p className={`nav-id-${this.props.id}`}>{this.props.id}</p> | |
| </div> | |
| ) | |
| } | |
| } | |