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

pragma has been set but pragmafrag has not been set #2305

Closed
lili21 opened this issue Nov 20, 2018 · 1 comment · Fixed by #2486
Closed

pragma has been set but pragmafrag has not been set #2305

lili21 opened this issue Nov 20, 2018 · 1 comment · Fixed by #2486

Comments

@lili21
Copy link
Contributor

lili21 commented Nov 20, 2018

🐛 bug report

Can't use React Fragments.

🎛 Configuration (.babelrc, package.json, cli command)

Default babel config

🤔 Expected Behavior

React Fragments should be supported by default.

😯 Current Behavior

Using Fragments will make babel throw error

image

💁 Possible Solution

https://github.com/parcel-bundler/parcel/blob/master/packages/core/parcel-bundler/src/transforms/babel/jsx.js#L45

should set the pragmaFrag for React.

@dburles
Copy link

dburles commented Dec 6, 2018

In the meantime adding this to your babel plugins solves it:

["@babel/plugin-transform-react-jsx", {
  "pragmaFrag": "React.Fragment"
}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants