mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
docs: fix optional argument representation (#4732)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user