This script allows you to use JSX in the browser with Babel transformed code, as if it were a normal DOM element.
Homepage Repository npm Download
This script allows you to use JSX in the browser with Babel compiled code in the
browser or with Babel standalone.
Use as if it were a normal DOM element created by document.createElement.
Just include both scripts like so:
<script src="https://glcdn.githack.com/pythondude325/rejsx/raw/master/main.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@babel/standalone@7.1.0/babel.min.js"></script>
Now you can simply use JSX in a script with type text/babel. Use the JSX as if you wre creating a DOM element with document.createElement.
document.body.appendChild(
<h1>Hello World</h1>
)
babel-standalone or @babel/standalone are required to use JSX. @babel/standalone is recommended and required if you want to use fragments.