From db0ec1ab0f5799ea7cee8e6e5d76f771fd27f699 Mon Sep 17 00:00:00 2001 From: Kevin Lacker Date: Thu, 3 Nov 2016 17:14:53 -0700 Subject: [PATCH] forms breakup --- docs/_data/nav_docs.yml | 3 +- docs/docs/forms.md | 587 ++++++--------------------- docs/docs/uncontrolled-components.md | 60 +++ 3 files changed, 175 insertions(+), 475 deletions(-) create mode 100644 docs/docs/uncontrolled-components.md diff --git a/docs/_data/nav_docs.yml b/docs/_data/nav_docs.yml index 1be1ce3c07..a6be939b77 100644 --- a/docs/_data/nav_docs.yml +++ b/docs/_data/nav_docs.yml @@ -34,6 +34,8 @@ title: Typechecking With PropTypes - id: refs-and-the-dom title: Refs and the DOM + - id: uncontrolled-components + title: Uncontrolled Components - id: optimizing-performance title: Optimizing Performance - id: react-without-es6 @@ -80,4 +82,3 @@ title: Shallow Compare - id: two-way-binding-helpers title: Two-way Binding Helpers - diff --git a/docs/docs/forms.md b/docs/docs/forms.md index 7916a08cb5..d631c75609 100644 --- a/docs/docs/forms.md +++ b/docs/docs/forms.md @@ -4,43 +4,35 @@ title: Forms permalink: docs/forms.html prev: state-and-lifecycle.html next: lifting-state-up.html -redirect_from: - - "tips/controlled-input-null-value.html" - - "docs/forms-zh-CN.html" +redirect_from: "tips/controlled-input-null-value.html" --- -Form components such as ``, ` ``` -This renders an input *initialized* with the value, `Untitled`. When the user updates the input, the node's `value` *property* will change. However, `node.getAttribute('value')` will still return the value used at initialization time, `Untitled`. +In React, a ` -``` - -For HTML, this easily allows developers to supply multiline values. However, since React is JavaScript, we do not have string limitations and can use `\n` if we want newlines. In a world where we have `value` and `defaultValue`, it is ambiguous what role children play. For this reason, you should not use children when setting `