Merge pull request #1952 from slorber/master

Update 09.2-form-input-binding-sugar.md -> document checkedLink
This commit is contained in:
Paul O’Shannessy 2014-08-13 15:32:27 -07:00
commit ec6653aa56
1 changed files with 5 additions and 1 deletions

View File

@ -65,7 +65,11 @@ var WithLink = React.createClass({
`ReactLink` objects can be passed up and down the tree as props, so it's easy (and explicit) to set up two-way binding between a component deep in the hierarchy and state that lives higher in the hierarchy.
Note that `<input>` supports ReactLink for both `value` and `checked`.
Note that checkboxes have a special behavior regarding their `value` attribute, which is the value that will be sent on form submit if the checkbox is checked (defaults to `on`). The `value` attribute is not updated when the checkbox is checked or unchecked. For checkboxes, you should use `checkedLink` instead of `valueLink`:
```
<input type="checkbox" checkedLink={this.linkState('booleanValue')} />
```
## Under the Hood