-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve compatibility with create-react-app #1446
Comments
Yes, I hope to maintain compatibly with That said, this library's I'm guessing that you filed this issue because all the examples point to the source code JSX. That is a historical aspect of this library being internal open source until just last October and complex application build flows are recommended to use the source code for flexibility. If that is the problem (copy and paste examples not working), I'm open to suggestions. Would a comment/heading above each example help clarify the need to change to named imports? I'd rather not have two example sets/files, but if we could automate the change with RegEx, AST etc. it might work. Something like this, maybe. Am I understanding your request correctly? |
Thanks for the detailed reply. I actually got this working with the default instructions on this repo and forgot to close this issue out. It seems that CRA does have a Babel loader for jsx configured. Closing this issue for now unless someone feels there's further follow up |
The create-react-app project supports JSX, but has decided to bundle a webpack config that does not look at the
.jsx
file extension. From facebook/create-react-app#87:While it is possible to 'eject' the configuration to modify the webpack loaders to support this project, one would lose the benefits of create-react-app.
One proposal would be to rename all the files to have a JS extension and update the docs to transpile
.js
files as JSX.Another proposal would be to have symlinks from
.js
to.jsx
files to support either.I recognize that this is a workaround to a 3rd party library that lightning has no dependency to. I'm new to both projects so perhaps the two are not commonly used together, or there is a preferred convention in the community I haven't discovered. I'm proposing this because create-react-app seems like a popular entry point for learning react, and I believe this project would benefit with better compatibility.
The text was updated successfully, but these errors were encountered: