diff --git a/docs/forms.html b/docs/forms.html index ef4ccb70a3..9a85c97a45 100644 --- a/docs/forms.html +++ b/docs/forms.html @@ -269,7 +269,17 @@ }
-Note how we used the ES6 computed property name syntax to update the state key corresponding to the given input name:
+this.setState({
+ [name]: value
+});
+It is equivalent to this ES5 code:
+var nextState = {};
+nextState[name] = value;
+this.setState(nextState);
+It can sometimes be tedious to use controlled components, because you need to write an event handler for every way your data can change and pipe all of the input state through a React component. This can become particularly annoying when you are converting a preexisting codebase to React, or integrating a React application with a non-React library. In these situations, you might want to check out uncontrolled components, an alternative technique for implementing input forms.