Assume I have the following code inside my HTML file, within the <body> tags:
<div id="root"></div>
<script type="text/babel">
class Element extends React.Component {...}
ReactDOM.render(<Element />, document.getElementById("root");
</script>
The above code works flawlessly. However, if I change it to the following:
<div id="root"></div>
<script type="text/babel">
class Element extends React.Component {...}
</script>
<script type="text/babel">
ReactDOM.render(<Element />, document.getElementById("root");
</script>
I just see a blank screen.
Why does React not work if the ReactDOM.render() call is made from a separate tag?