Skip to content

Instantly share code, notes, and snippets.

@RusAlex
Created March 22, 2015 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RusAlex/32ab61e18e025face9ac to your computer and use it in GitHub Desktop.
Save RusAlex/32ab61e18e025face9ac to your computer and use it in GitHub Desktop.
define(['react'], (React) => {
class TestView extends React.Component {
constructor(props) {
super(props);
this.state = {
value: 10
};
}
handleChange() {
console.log(this);
this.setState({value: event.target.value});
}
render() {
var value = this.state.value;
return(
<div className="testView">
<input type="text" defaultValue={value} onChange={this.handleChange.bind(this)} />
{value}
</div>
);
}
}
return TestView;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment