| 31 | // }; |
| 32 | |
| 33 | class 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 | |
| 54 | ReactDOM.render(<App />, document.querySelector('#container')); |
nothing calls this directly
no outgoing calls
no test coverage detected