Browse Source
Fix setState example code
Seems to have been a mix of the two examples the section was covering.
main
Thomas Levy
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
content/docs/reference-react-component.md
|
|
@ -347,7 +347,7 @@ Subsequent calls will override values from previous calls in the same cycle, so |
|
|
|
|
|
|
|
```js |
|
|
|
this.setState((prevState) => { |
|
|
|
return {counter: prevState.quantity + 1}; |
|
|
|
return {quantity: prevState.quantity + 1}; |
|
|
|
}); |
|
|
|
``` |
|
|
|
|
|
|
|