I am trying to include a bunch of React elements I have in file myfile.jsx
<script type="text/babel" src="http://example.com/js/r/myfile.jsx"></script>
This does not work.
If I try to put import "http://example.com/js/r/myfile.jsx";
it tells me require
is not defined.
Is there a simple way, via script
tag to include jsx code?
I am using it on the web only, I use Babel to transpile it.
Below is my header, code works fine when all is in the same page.
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>