I'm trying to pack-up a (react) module i made using this program but when i try to use the generated js files i'm getting this error: Uncaught ReferenceError: h is not defined.
I'm not familiar with creating JS modules and this is my first ever JS module so this issue might be a bit stupid.
.js file into my projectI've tried to show reproduced the issue with as minimal code as possible here:
https://github.com/mjarkk/microbundle-example
/ folder contains the module /example/ folder contains a simple react project with the module imported. In the real project where this issue started i'm using webpack in staid of parcel but the issue is exactly the same there.
JSX transpiration defaults to using h as the constructor function. With react you need to set it to React.createElement instead. This can be done via the --jsx flag.
Thanks that did the trick.
Most helpful comment
Thanks that did the trick.