I'm developing a ReactJS application using Babel/JSX syntax. I want to write an module made of React's components. But I cannot use objects of a babel script inside a Javascript the same way I could use objects of a Javascript inside another Javascript.
Html:
<script src="/js/react_babel_jsx.js" type="text/babel" ></script>
<script src="/js/my_javascript.js"></script>
/js/react_babel_jsx.js:
var Test = function(){
this.hello = function () {
console.log('Hello!')
}
}
/js/my_javascript.js
new Test().hello()
Console output in Chrome:
my_javascript.js:3 Uncaught ReferenceError: Test is not defined
How could I use Babel script's objects inside a Javascript?