Download next.js/test/production/export/pages/dynamic.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 608 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/export/pages/dynamic.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/production/export/pages/dynamic.js
-
curl -L -o dynamic.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/export/pages/dynamic.js
608 Bytes
| /* global location */ | |
| import React from 'react' | |
| import Link from 'next/link' | |
| export default class DynamicPage extends React.Component { | |
| static getInitialProps({ query }) { | |
| return { text: query.text } | |
| } | |
| state = {} | |
| componentDidMount() { | |
| const [, hash] = location.href.split('#') | |
| this.setState({ hash }) | |
| } | |
| render() { | |
| const { text } = this.props | |
| const { hash } = this.state | |
| return ( | |
| <div id="dynamic-page"> | |
| <div> | |
| <Link href="/">Go Back</Link> | |
| </div> | |
| <p>{text}</p> | |
| <div id="hash">Hash: {hash}</div> | |
| </div> | |
| ) | |
| } | |
| } | |