MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / App

Class App

code/controlled-uncontrolled/src/app.jsx:33–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31// };
32
33class App extends React.Component {
34 constructor(props) {
35 super(props);
36 this.state = { value: 'hello' };
37 this._change = this._handleInputChange.bind(this);
38 }
39 render() {
40 return (
41 <input
42 type='text'
43 defaultValue={ this.state.value }
44 onChange={ this._change }
45 ref={ input => this.input = input }/>
46 );
47 }
48 _handleInputChange() {
49 console.log(this.input.value);
50 this.setState({ value: this.input.value });
51 }
52};
53
54ReactDOM.render(<App />, document.querySelector('#container'));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected