Download next.js/test/development/pages-dir/client-navigation/fixture/lib/cdm.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 402 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/pages-dir/client-navigation/fixture/lib/cdm.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/pages-dir/client-navigation/fixture/lib/cdm.js
-
curl -L -o cdm.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/pages-dir/client-navigation/fixture/lib/cdm.js
402 Bytes
| import React, { Component } from 'react' | |
| export default class extends Component { | |
| constructor(props) { | |
| super(props) | |
| this.state = { | |
| mounted: false, | |
| } | |
| } | |
| componentDidMount() { | |
| this.setState({ mounted: true }) | |
| } | |
| render() { | |
| return ( | |
| <p> | |
| ComponentDidMount{' '} | |
| {this.state.mounted ? 'executed on client' : 'not executed'}. | |
| </p> | |
| ) | |
| } | |
| } | |