Where should ReactDOM be imported from? Where should ReactDOM be imported from? javascript javascript

Where should ReactDOM be imported from?


With the new update, all the DOM stuff you do should be done with ReactDOM instead of React. It's a separate module.

Do npm install react-dom and then, if you're using ES6, you can do:

import ReactDOM from 'react-dom';

or if you're using ES5 you can just do:

var ReactDOM = require('react-dom');

and then you can use ReactDOM.render(), ReactDOM.findDOMNode(), etc in your code.