Browse Source
Merge pull request #290 from NilSet/master
Fix setState example code
main
Brian Vaughn
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}; |
|
|
|
}); |
|
|
|
``` |
|
|
|
|
|
|
|