diff --git a/docs/docs/forms.md b/docs/docs/forms.md index 8724ea58ed..d7c06e33a9 100644 --- a/docs/docs/forms.md +++ b/docs/docs/forms.md @@ -29,7 +29,7 @@ We can combine the two by making the React state be the "single source of truth" For example, if we want to make the previous example log the name when it is submitted, we can write the form as a controlled component: -```javascript{4,10-12,23} +```javascript{4,10-12,24} class NameForm extends React.Component { constructor(props) { super(props); @@ -62,7 +62,7 @@ class NameForm extends React.Component { } ``` -[Try it on CodePen.](https://codepen.io/lacker/pen/oYNzxY?editors=0010) +[Try it on CodePen.](https://codepen.io/gaearon/pen/VmmPgp?editors=0010) 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. @@ -86,7 +86,7 @@ In HTML, a `