Skip to content

Instantly share code, notes, and snippets.

@devhyunjae
Created March 18, 2016 02:31
Show Gist options
  • Save devhyunjae/58f20cb00e8d35e63404 to your computer and use it in GitHub Desktop.
Save devhyunjae/58f20cb00e8d35e63404 to your computer and use it in GitHub Desktop.
class AppES6 extends React.Component{
constructor(){
super();
this.state = {foo: 1};
this.handleChange = this.handleChange.bind(this);
}
handleChange(e) {
this.setState({foo: e.target.value});
}
render() {
return(
<input type="text" onChange={this.handleChange}/>
{this.state.foo}
);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment