gaearon / react-hot-boilerplate

Minimal live-editing example for React
MIT License
3.91k stars 879 forks source link

Avoid using return value from `ReactDOM.render()` #125

Open elementsweb opened 7 years ago

elementsweb commented 7 years ago

According to the ReactDOM documentation at https://facebook.github.io/react/docs/react-dom.html#render, we should avoid using the return value from ReactDOM.render():

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 to the root element.