mirror of
https://github.com/facebook/react.git
synced 2026-02-26 05:15:03 +00:00
Fix typo on tutorial.md. (#9644)
The absence of the word `this` will cause CodePen to scream at you. This fix should avoid that.
This commit is contained in:
committed by
Dan Abramov
parent
c1ba8ef264
commit
7c1e971e7f
@@ -221,7 +221,7 @@ In [JavaScript classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/
|
||||
Now change the Square `render` method to display the value from the current state, and to toggle it on click:
|
||||
|
||||
* Replace `this.props.value` with `this.state.value` inside the `<button>` tag.
|
||||
* Replace the `() => alert()` event handler with `() => setState({value: 'X'})`.
|
||||
* Replace the `() => alert()` event handler with `() => this.setState({value: 'X'})`.
|
||||
|
||||
Now the `<button>` tag looks like this:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user