docs: fix optional argument representation (#4732)

This commit is contained in:
Kim Brandwijk
2022-06-10 08:40:28 +02:00
committed by GitHub
parent 678caa54ca
commit 4bfd89654f

View File

@@ -507,7 +507,7 @@ There are just two of them: `setState()` and `forceUpdate()`.
### `setState()` {#setstate}
```javascript
setState(updater, [callback])
setState(updater[, callback])
```
`setState()` enqueues changes to the component state and tells React that this component and its children need to be re-rendered with the updated state. This is the primary method you use to update the user interface in response to event handlers and server responses.