error solved

Fix – ReactDOM is not defined


If you are getting ReactDom is not defined in React, this article will help you fix the issue.

This issue could pop out because: you don’t have module react-dom properly installed inside your project and you tried to call it, or simply you didn’t call this module correctly.

To fix that, you will need to make sure the module exists in your project, and you call it correctly. Here is the example:

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));

Notes :
– The name you use to import should be exactly the same as the name when you use it. Try double-checking the name if this error still occured.


Share on social media

//