reactdom not working in code sandbox for react Html file has:
<body>
<div id="root"></div>
</body>
<script src="scr/index.js">
JavaScript (named index)file has:
ReactDOM.render(<p>Hello</p>, document.getElementById('root'));
the line of code in js is not recognized and error pops up that line: ReactDOM.render is not a function
You need to call render method from div with id="root", not from ReactDOM.
const root = ReactDOM.createRoot(
document.getElementById('root'));
root.render(
<p>Hello</p>
);
or
ReactDOM.createRoot(document.getElementById('root')).render(<p>Hello</p>);