Skip to content

Commit 4bfd896

Browse files
authored
docs: fix optional argument representation (#4732)
1 parent 678caa5 commit 4bfd896

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/docs/reference-react-component.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ There are just two of them: `setState()` and `forceUpdate()`.
507507
### `setState()` {#setstate}
508508

509509
```javascript
510-
setState(updater, [callback])
510+
setState(updater[, callback])
511511
```
512512

513513
`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.

0 commit comments

Comments
 (0)