add link to useful doc
Kevin Lacker committed
Nov 17, 2016 at 10:49 UTC
02966c79453a447f27075b26204d29a1f0412727
1 file changed
+2
docs/docs/uncontrolled-components.md
+2
@@ -40,6 +40,8 @@ class NameForm extends React.Component {
40
41
Since an uncontrolled component keeps the source of truth in the DOM, it is sometimes easier to integrate React and non-React code when using uncontrolled components. It can also be slightly less code if you want to be quick and dirty. Otherwise, you should usually use controlled components.
42
43
+If it's still not clear which type of component you should use for a particular situation, you might find [this article on controlled versus uncontrolled inputs](http://goshakkk.name/controlled-vs-uncontrolled-inputs-react/) to be helpful.
44
+
45
### Default Values
46
47
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`.