So I've been reading the basic guide and have set up a hello world file with no npm or anything, just an html file.
According to ReactJS: "Uncaught SyntaxError: Unexpected token <" I should have the script type set to text/jsx
or text/babel
. Neither work, since neither print the "hi" or do anything.
<html>
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<div id="root">
</div>
<script type="text/jsx">
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('root')
);
console.log("hi");</script>
</html>
What's going on and how do I get it to execute?