rejsx
v1.1.1
Published
This script allows you to use JSX in the browser with Babel transformed code, as if it were a normal DOM element.
Downloads
3
Maintainers
Readme
Rejsx
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
.
How to use
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/[email protected]/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>
)
Dependencies
babel-standalone or @babel/standalone are required to use JSX. @babel/standalone is recommended and required if you want to use fragments.