Skip to content

Commit

Permalink
fix(gatsby-plugin-emotion): allow for React.Fragment shorthand syntax (
Browse files Browse the repository at this point in the history
…#10291)

This change resolves the following error thrown by `@babel/plugin-transform-react-jsx` when using the React.Fragment shorthand syntax (`<> </>`) in conjunction with emotion v10 and `gatsby-plugin-emotion` v3:

```
Error: transform-react-jsx: pragma has been set but pragmafrag has not been set
```
  • Loading branch information
wKovacs64 authored and DSchau committed Dec 5, 2018
1 parent 6261493 commit 3c902fc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/gatsby-plugin-emotion/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const onCreateBabelConfig = ({ actions }, pluginOptions) => {
name: `@babel/plugin-transform-react-jsx`,
options: {
pragma: pragmaName,
pragmaFrag: `React.Fragment`,
},
})

Expand Down

0 comments on commit 3c902fc

Please sign in to comment.