Skip to content
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

Use shorthand Fragment syntax everywhere #2444

Merged
merged 1 commit into from
May 28, 2019

Conversation

swissspidy
Copy link
Collaborator

This removes the need for explicit imports, as these are handled by Babel.

This has been made possible by an upstream change in Gutenberg, see WordPress/gutenberg#15120. Example:

function MyComponent( props ) {
  return <>
    <h1>Hello!</h1>
    <h2>👋</h2>
  </>;
}

/* ⬇️ After transform ⬇️ */

import { createElement, Fragment } from '@wordpress/element';
function MyComponent( props ) {
  return <>
    <h1>Hello!</h1>
    <h2>👋</h2>
  </>;
}

This removes the need for explicit imports, as these are handled by Babel.
@swissspidy swissspidy added this to the v1.2 milestone May 28, 2019
@googlebot googlebot added the cla: yes Signed the Google CLA label May 28, 2019
Copy link
Contributor

@miina miina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Seems to work as expected.

@swissspidy swissspidy merged commit e658e38 into develop May 28, 2019
@swissspidy swissspidy deleted the use/shorthand-fragment-syntax branch May 28, 2019 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Signed the Google CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants