react
react copied to clipboard
Controlled Components 'value' Not Being Reflected In The DOM
I noticed that the input's value is not updated in the DOM when implementing a controlled component. Is this normal / expected behavior?
<div>
<input
// Controlled Component
value={this.state.term}
onChange={(event) => this.setState({ term: event.target.value })} />
</div>
Here is a link to an example on JSBin (When it first loads press 'Run with JS' button in Output section): http://jsbin.com/sodojo/1/edit?html,js,output
Have you seen this~?
https://facebook.github.io/react/docs/forms.html
@drizko You should read this: http://stackoverflow.com/questions/6003819/properties-and-attributes-in-html
Thank you both for the resources, issue closed