Most reusable React components I have seen offer a CommonJS-compatible distribution that has the JSX files transpiled to ES5. You do have a version of these files in dist, but they rely on having a global React reference instead of it being required.
In our environment (where we render on the server and use webpack to prepare files for the browser), we cannot directly require either react-menu or react-menu/dist/react-menu. The first fails, because the files in lib include JSX and the second fails because we do not expose React globally.
Do you have a suggestion? I'm happy to offer a pull request with your guidance.
Most reusable React components I have seen offer a CommonJS-compatible distribution that has the JSX files transpiled to ES5. You do have a version of these files in
dist, but they rely on having a global React reference instead of it being required.In our environment (where we render on the server and use webpack to prepare files for the browser), we cannot directly require either
react-menuorreact-menu/dist/react-menu. The first fails, because the files inlibinclude JSX and the second fails because we do not expose React globally.Do you have a suggestion? I'm happy to offer a pull request with your guidance.