Is there any difference between React.render() and ReactDOM.render()?

This is a very recent change introduced with 0.14. They split up React into a core library and the DOM adapter. Rendering is now done via ReactDOM.render.

https://facebook.github.io/react/blog/2015/10/07/react-v0.14.html


React.render has been deprecated as of React 0.14. With packages like react-native, react-art, react-canvas, and react-three, it is clear that the beauty and essence of React has nothing to do with browsers or the DOM.

To make this more clear and to make it easier to build more environments that React can render to, the main react package has been split into two: react and react-dom.

This paves the way to writing components that can be shared between the web version of React and React Native.

The react package contains React.createElement, .createClass, .Component, .PropTypes, .Children, and the other helpers related to elements and component classes. Think of these as the isomorphic or universal helpers that you need to build components.

The react-dom package has ReactDOM.render, .unmountComponentAtNode, and .findDOMNode.

Tags:

Reactjs