-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix: set default pragmaFrag option 🐛 #2486
Conversation
require('@babel/plugin-transform-react-jsx'), | ||
{ | ||
pragma, | ||
pragmaFrag: 'React.Fragment' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to create a mapping similar to the one for pragma for other react-alike libraries (preact etc.) if they also support fragments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lili21 Do you have an idea for how to do this?
EDIT: did some research, see below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devongovett There is no official support for fragments in Preact, NervJS, and HyperApp.
Can't we merge this PR for now and add support for those libraries when they officially support it? It's frustrating to have to add a config for something that is supported to be the default option in Babel.
We are literally forcing users to do more configuration than the default Babel behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree.
I am happy to open a new PR for this as it seems this PR is now out of sync and hasn't had any attention for a while. |
@lili21 Can you rebase off master? And can @devongovett review this again and merge it? Please take into consideration my comments here: #2486 (comment) |
ba355f6
to
722e03a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as the other frameworks don't support fragments yet
Thanks everyone! |
fix #2305
↪️ Pull Request
💻 Examples
🚨 Test instructions
✔️ PR Todo