More explicit docs about uncontrolled forms. (#3382)

This commit is contained in:
Wojciech Golaszewski
2020-11-12 13:18:19 +01:00
committed by GitHub
parent 9b8dee54f2
commit a9239a586e

View File

@@ -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() {