I'm using react@18 in "standalone" mode and get a warning using createRoot
.
The reactjs code is inlined in the HTML file, in a script section - . The HTML header in the current HTML file includes these sources:
<script src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
I attempt to access createRoot() like this:
const root = ReactDOM.createRoot(container);
That line leads to this error -> Warning: You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".
What is the correct way to import this from "react-dom/client"? What is the correct way to do this standalone - <script src=" ... "></script>
to use?