It works perfectly because I haven\'t included JSX, but when I replace the script type with text/babel
, it doesn\'t work because the module fails to load. bro
you may prefer to use an alias to createElement
. This way is faster for the engine.
For example use h
or e
.
const { createElement: h } = React;
const App = () => {
return h('div', {}, 'hello!!');
}
Otherwise, it is possible to use @babel/standalone
module, please see more on here https://babeljs.io/docs/en/next/babel-standalone.html.