Download wp-calypso/client/components/forms/counted-textarea/docs/example.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 479 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/forms/counted-textarea/docs/example.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/forms/counted-textarea/docs/example.jsx
-
curl -L -o example.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/forms/counted-textarea/docs/example.jsx
479 Bytes
| import { PureComponent } from 'react'; | |
| import CountedTextarea from 'calypso/components/forms/counted-textarea'; | |
| export default class extends PureComponent { | |
| static displayName = 'CountedTextareas'; | |
| state = { | |
| value: 'Hello World!', | |
| }; | |
| onChange = ( event ) => { | |
| this.setState( { | |
| value: event.target.value, | |
| } ); | |
| }; | |
| render() { | |
| return ( | |
| <CountedTextarea | |
| value={ this.state.value } | |
| onChange={ this.onChange } | |
| acceptableLength={ 20 } | |
| /> | |
| ); | |
| } | |
| } | |