-
Notifications
You must be signed in to change notification settings - Fork 4.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
JSX: Use <> Fragments with transforms #15261
Conversation
17f8101
to
c34aed0
Compare
I like how it simplifies the code by removing the need to import I'm wondering whether it should be enforced to use Another question is, how we can communicate in docs that both |
I do think this syntax should be preferred, however there are still places where |
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.
There's a merge conflict to be addressed. It otherwise appears in good order. The specific syntax is a bit off-putting to me (vs. the "explicit" Fragment), but I sense it's a matter of becoming accustomed to, and can be reinforced as a pattern increasingly common to any React project.
c34aed0
to
da935a6
Compare
I share the same sentiment, in general, it should simplify everything :) |
Description
#15120 adds
Fragment
handling to@wordpress/babel-plugin-import-jsx-pragma
and prepares@wordpress/babel-preset-default
for the WordPress environment.Leverage the
<></>
automaticFragment
import provided by the babel transform included in the preset. Follow-up to #15120.How has this been tested?
Inspect transformed code to ensure imports and JSX transforms are working correctly.
Smoke test code using
<></>
.Types of changes
Janitorial.
Checklist: