In index.html
I have:
<div class="header-content-inner" id="example">
...
</div>
And then:
<script src="js/react-dom.js"></script>
<script src="js/react.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script type="text/babel" src="js/segui-info.jsx"></script>
This "segui-info" is the external js file with react code in it:
import React from 'react';
import ReactDOM from 'react-dom';
var ex = <h1>It worked!</h1>;
ReactDOM.render(ex, document.getElementById("example"));
As you can guess, the "ex" is not being appended / rendered to that div. I'm a beginner to react and I'm failing to understand why it's not working. In simple examples just like this one they use react code inside a <script>
tag. I don't want to use all the react code inside a .html file. What am I doing wrong?
EDIT: This is what I get on the console: