From 4bfd89654fa19e6f2bfd1b9f60e96d0dd11c8398 Mon Sep 17 00:00:00 2001 From: Kim Brandwijk Date: Fri, 10 Jun 2022 08:40:28 +0200 Subject: [PATCH] docs: fix optional argument representation (#4732) --- content/docs/reference-react-component.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/reference-react-component.md b/content/docs/reference-react-component.md index 487706e0..23cfabba 100644 --- a/content/docs/reference-react-component.md +++ b/content/docs/reference-react-component.md @@ -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.