class App extends React.Component {
constructor(props) {
super(props);
this.state = {
data: 'Bound data...'
}
this.updateState = this.updateState.bind(this);
};
updateState(e) {
this.setState({data: e.target.value});
}
render() {
return (
<>
<input type="text" value = {this.state.data} onChange = {this.updateState} />
<h4>{this.state.data}</h4>
</>
);
}
}
ReactDOM.render(
<App />, document.getElementById('mountNode') );