My code is very simple. I checked all the resources, rewrote the code into different files, updated my computer, checked the css files and everything is fine and I can't see the problem.
react.html:
<html> <head> <link rel="stylesheet" href="react.css"> <script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script> <script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"><script> </head> <body> <div id="root"></div> <script src="react.js" type="text/babel"></script> </body> </html>
react.js:
ReactDOM.render(<h1>Hello, World!</h1>, document.querySelector("#root")) ``` tried document.getElementById("root") as well
To use
@babel/standalone
you also need to load it, otherwisetype="text/babel"
won't work.