I've been studying React and now I want to try implementing it on some pages only, as a proof-of-concept to my supervisor at work. How do I do that using old-school script tags, instead of imports?
I've been able to use the in-browser babel transpiler
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
</head>
<body>
<div id="output"></div>
<script type="text/babel">
ReactDOM.render(
<div>Hello world!!</div>,
document.getElementById("output")
);
</script>
</body>
</html>
This works, but how do I create react components here? Creating a class that extends Component will throw an undefined error. How do I do import React, {Component} from 'react'; using this method? And how do I use components in external jsx files?