react-es6-component
v0.0.4
Published
ES6 React Component that autobinds methods like the non-es6 JSX version does automatically.
Downloads
112
Readme
React ES6 Component
This component binds its methods, like the old-style React.createClass, so that "this" points to the right thing.
Usage
import Component from 'react-es6-component';
class MyComponent extends Component {
render(){
return (
<div>
<button onClick={this._magicAutoboundMethod} />
</div>
);
}
_magicAutoboundMethod(){
this.setState({
foo: 'bar'
});
}
}