From b20566ba96ee301ad449ade81f34271acacc83de Mon Sep 17 00:00:00 2001 From: Fanny Vieira Date: Fri, 6 Oct 2017 18:48:39 -0300 Subject: [PATCH] fix #16 missing documentation: null/undefined as input value --- content/docs/controlled-input-null-value.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 content/docs/controlled-input-null-value.md diff --git a/content/docs/controlled-input-null-value.md b/content/docs/controlled-input-null-value.md new file mode 100644 index 00000000..b6e5a72b --- /dev/null +++ b/content/docs/controlled-input-null-value.md @@ -0,0 +1,19 @@ +--- +id: controlled-input-null-value +title: Controlled input null value +permalink: docs/controlled-input-null-value.html +--- + +Specifying the value prop on a [controlled component](/docs/forms.html) prevents the user from changing the input unless you desire so. + +You might have run into a problem where value is specified, but the input can still be changed without consent. In this case, you might have accidentally set value to undefined or null. + +For example, this code shows this phenomenon; after a second, the text becomes editable. +```javascript +ReactDOM.render(, mountNode); + +setTimeout(function() { + ReactDOM.render(, mountNode); +}, 1000); + +``` \ No newline at end of file