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

Add support for JSX-Fragments #3341

Closed
marvinhagemeister opened this issue Nov 28, 2017 · 3 comments
Closed

Add support for JSX-Fragments #3341

marvinhagemeister opened this issue Nov 28, 2017 · 3 comments
Labels
lang:jsx Issues affecting JSX (not general JS issues) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! type:enhancement A potential new feature to be added, or an improvement to how we print something
Milestone

Comments

@marvinhagemeister
Copy link

Prettier 1.8.2
Playground link

Input:

const Foo = <>
        <div>Hello World</div>
</>;

Output:

SyntaxError: Unexpected token (1:14)
> 1 | const Foo = <>
    |              ^
  2 |         <div>Hello World</div>
  3 | </>;
  4 | 

Expected behavior:

React 16.2.0 was just released with support for jsx fragments. These are currently not recognized by prettier and lead to syntax error.

Link to JSX-Fragments spec

@ikatyang
Copy link
Member

There's already a WIP PR, see #3237.

@ikatyang ikatyang added lang:jsx Issues affecting JSX (not general JS issues) status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! type:enhancement A potential new feature to be added, or an improvement to how we print something labels Nov 28, 2017
@suchipi suchipi added this to the 1.9 milestone Nov 29, 2017
@ikatyang
Copy link
Member

Fixed in #3237.

@marvinhagemeister
Copy link
Author

@ikatyang That's awesome! Much appreciated 👍

@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 6, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:jsx Issues affecting JSX (not general JS issues) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! type:enhancement A potential new feature to be added, or an improvement to how we print something
Projects
None yet
Development

No branches or pull requests

3 participants