ReactDOM
These docs are old and won’t be updated. Go to react.dev for the new React docs.
These new documentation pages teach modern React:
The react-dom package provides DOM-specific methods that can be used at the top level of your app and as an escape hatch to get outside the React model if you need to.
import * as ReactDOM from 'react-dom';If you use ES5 with npm, you can write:
var ReactDOM = require('react-dom');The react-dom package also provides modules specific to client and server apps:
İcmal
The react-dom package exports these methods:
These react-dom methods are also exported, but are considered legacy:
Note:
Both
renderandhydratehave been replaced with new client methods in React 18. These methods will warn that your app will behave as if it’s running React 17 (learn more