Conversation
|
I think it's okay to change the
|
|
Also, I'm curious why this will fix the "Cannot use import statement outside a module" issue. The compiled files are still in ESM, if your project doesn't use ESM and there's no transpiler (e.g. Webpack), you'll still get this error. Maybe |
|
I'd definitely love it if this had a CommonJS distribution; I'm currently struggling to get this to import using babel in a CommonJS-based project. |
CJS is on the way, but there're some issues to solve. A new version with CJS support will be released once I finish my company work (in a day or two I think). |
|
For what it's worth, I forked your main branch and published what you have to a private package repository, and the CommonJS export is working great. Looking forward to when it's published. |
|



Fixes #12.
Based on below resources, I changed
"jsx": "react-jsx"in tsconfig.json. It allows proper jsx compilation withoutimport React from 'react'.https://stackoverflow.com/questions/64656055/react-refers-to-a-umd-global-but-the-current-file-is-a-module/65539274#65539274
https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#jsx-factories