[React.14] Add checkedLink/valueLink to HTMLAttributes for LinkedStateMixin

This commit is contained in:
Vincent Siao
2015-11-10 23:43:36 -08:00
parent bef72125ab
commit 813f3b03db
3 changed files with 29 additions and 4 deletions
+19 -2
View File
@@ -466,8 +466,25 @@ React.createFactory(CSSTransitionGroup)({
// LinkedStateMixin addon
// --------------------------------------------------------------------------
React.createClass({
mixins: [LinkedStateMixin],
render: function() { return React.DOM.div(null) }
mixins: [LinkedStateMixin],
getInitialState: function() {
return {
isChecked: false,
message: "hello!"
};
},
render: function() {
return React.DOM.div(null,
React.DOM.input({
type: "checkbox",
checkedLink: this.linkState("isChecked")
}),
React.DOM.input({
type: "text",
valueLink: this.linkState("message")
})
);
}
});
//