Skip to content

Commit

Permalink
Document legacyness of the return value of ReactDOM.render()
Browse files Browse the repository at this point in the history
  • Loading branch information
jimfb authored and jim committed Apr 6, 2016
1 parent a5c164d commit 01bab11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/docs/ref-01-top-level-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ The `react-dom` package provides DOM-specific methods that can be used at the to
### ReactDOM.render

```javascript
ReactComponent render(
render(
ReactElement element,
DOMElement container,
[function callback]
Expand All @@ -161,6 +161,10 @@ If the optional callback is provided, it will be executed after the component is
> `ReactDOM.render()` does not modify the container node (only modifies the children of the container). In
> the future, it may be possible to insert a component to an existing DOM node without overwriting
> the existing children.
>
> `ReactDOM.render()` currently returns a reference to the root `ReactComponent` instance. However, using this return value is legacy
> and should be avoided because future versions of React may render components asynchronously in some cases. If you need a reference to the root `ReactComponent` instance, the preferred solution is to attach a
> [callback ref](/react/docs/more-about-refs.html#the-ref-callback-attribute) to the root element.


### ReactDOM.unmountComponentAtNode
Expand Down

0 comments on commit 01bab11

Please sign in to comment.