From f8ef2e4efe8e3d21df65855a47ce29a2808050b6 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 17 Nov 2016 19:09:04 +0000 Subject: [PATCH] Merge pull request #8335 from lacker/newlink add link to useful doc --- docs/docs/uncontrolled-components.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/docs/uncontrolled-components.md b/docs/docs/uncontrolled-components.md index e464f319ef..2eaac55f6f 100644 --- a/docs/docs/uncontrolled-components.md +++ b/docs/docs/uncontrolled-components.md @@ -40,6 +40,8 @@ class NameForm extends React.Component { 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. +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. + ### 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`.