Parcel: pragma has been set but pragmafrag has not been set

Created on 20 Nov 2018  路  1Comment  路  Source: parcel-bundler/parcel

馃悰 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.

Good First Issue Bug

Most helpful comment

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

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

>All comments

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

["@babel/plugin-transform-react-jsx", {
  "pragmaFrag": "React.Fragment"
}]
Was this page helpful?
0 / 5 - 0 ratings