Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.17 KB

README.md

File metadata and controls

31 lines (24 loc) · 1.17 KB

react-linked-state

Deep path two-way binding for React.

NPM Version npm Build Status License

npm install --save react-linked-state

Usage

Use it like official's Two-Way Binding Helpers, the only different is this module support deep path.

var LinkedStateMixin = require('react-linked-state');

var WithLink = React.createClass({
  mixins: [LinkedStateMixin],
  getInitialState: function() {
    return {data: {message: 'Hello!'}};
  },
  render: function() {
    return <input type="text" valueLink={this.linkState('data.message')} />;
  }
});