I used react.js in my new project and found that javascript didn't work when I used ReactDOM to render class extended from React.Component
When script which fire alert() method is used as last it does not works. When I change order of scripts, they work.
<div id="root"></div>
<div id="hello"><div>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script>
class HelloReact extends React.Component {
render() {
return React.createElement("div", null, React.createElement("h1", null, "Hello world 1!"));
}
}
ReactDOM.render(React.createElement(HelloReact, null), document.getElementById("hello"));
ReactDOM.render(React.createElement("h1", null, "Hello, world 2!"), document.getElementById('root'));
</script>
<script>alert("Hello");</script>
I would know is it normal (and I should not use javascript code after scripts with react code) or there is a bug in react library?
I was checking in Dev Tools and wasn't see any errors. I added files to github [ https://github.com/darekjk/reactjs_examples/tree/master/react-js-problem-20181231 ] to be sure I didn't make any error in copy/paste.

