Enables two way binding on decorated components via linkState and valueLink.
npm install react-linkstate-decorator




and then use the default export of the module.
createlinkState method to the component's linkState attribute for easy use. For more information about linkState and the valueLink property, please visit [https://facebook.github.io/react/docs/two-way-binding-helpers.html] (https://facebook.github.io/react/docs/two-way-binding-helpers.html).
javascript
import LinkState from 'react-linkstate-decorator';
class ChildComponent extends Component {
render() {
return (
{this.props.valueLink.value}
);
}
}
@LinkState
class ParentComponent extends Component {
constructor() {
super();
this.state = {
val: 1
};
}
render() {
return (
);
}
}
``