Skip to content

Switching to a more popular representation of optional arguments #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/docs/reference-react-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ For more details, see [*Error Handling in React 16*](/blog/2017/07/26/error-hand
### `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.
Expand Down Expand Up @@ -323,7 +323,7 @@ The second parameter to `setState()` is an optional callback function that will
You may optionally pass an object as the first argument to `setState()` instead of a function:

```javascript
setState(stateChange, [callback])
setState(stateChange[, callback])
```

This performs a shallow merge of `stateChange` into the new state, e.g., to adjust a shopping cart item quantity:
Expand Down
12 changes: 2 additions & 10 deletions content/docs/reference-react-dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ React supports all popular browsers, including Internet Explorer 9 and above.
### `render()`

```javascript
ReactDOM.render(
element,
container,
[callback]
)
ReactDOM.render(element, container[, callback])
```

Render a React element into the DOM in the supplied `container` and return a [reference](/docs/more-about-refs.html) to the component (or returns `null` for [stateless components](/docs/components-and-props.html#functional-and-class-components)).
Expand All @@ -63,11 +59,7 @@ If the optional callback is provided, it will be executed after the component is
### `hydrate()`

```javascript
ReactDOM.hydrate(
element,
container,
[callback]
)
ReactDOM.hydrate(element, container[, callback])
```

Same as [`render()`](#render), but is used to hydrate a container whose HTML contents were rendered by [`ReactDOMServer`](/docs/react-dom-server.html). React will attempt to attach event listeners to the existing markup.
Expand Down