From 0c2f867a4cb5808e72e2109441d7932368349378 Mon Sep 17 00:00:00 2001 From: Alessandro De Blasis Date: Sun, 24 Feb 2019 10:16:33 +0000 Subject: [PATCH 01/14] wip --- content/docs/forms.md | 3 +++ examples/forms/1.js | 30 +++++++++++++++++++++++++++++ examples/forms/2.js | 35 +++++++++++++++++++++++++++++++++ examples/forms/3.js | 45 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 examples/forms/1.js create mode 100644 examples/forms/2.js create mode 100644 examples/forms/3.js diff --git a/content/docs/forms.md b/content/docs/forms.md index 1a8b599d5..68007b3cd 100644 --- a/content/docs/forms.md +++ b/content/docs/forms.md @@ -65,6 +65,7 @@ class NameForm extends React.Component { ``` [**Try it on CodePen**](https://codepen.io/gaearon/pen/VmmPgp?editors=0010) +[](codepen://forms/1) Since the `value` attribute is set on our form element, the displayed value will always be `this.state.value`, making the React state the source of truth. Since `handleChange` runs on every keystroke to update the React state, the displayed value will update as the user types. @@ -179,6 +180,7 @@ class FlavorForm extends React.Component { ``` [**Try it on CodePen**](https://codepen.io/gaearon/pen/JbbEzX?editors=0010) +[](codepen://forms/2) Overall, this makes it so that ``, ` ``` -In React, a `