Browse Source

More explicit docs about uncontrolled forms. (#3382)

main
Wojciech Golaszewski 4 years ago
committed by GitHub
parent
commit
a9239a586e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      content/docs/uncontrolled-components.md

2
content/docs/uncontrolled-components.md

@ -45,7 +45,7 @@ If it's still not clear which type of component you should use for a particular
### Default Values {#default-values}
In the React rendering lifecycle, the `value` attribute on form elements will override the value in the DOM. With an uncontrolled component, you often want React to specify the initial value, but leave subsequent updates uncontrolled. To handle this case, you can specify a `defaultValue` attribute instead of `value`.
In the React rendering lifecycle, the `value` attribute on form elements will override the value in the DOM. With an uncontrolled component, you often want React to specify the initial value, but leave subsequent updates uncontrolled. To handle this case, you can specify a `defaultValue` attribute instead of `value`. Changing the value of `defaultValue` attribute after a component has mounted will not cause any update of the value in the DOM.
```javascript{7}
render() {

Loading…
Cancel
Save