-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(gatsby-plugin-emotion): allow for React.Fragment shorthand syntax #10291
fix(gatsby-plugin-emotion): allow for React.Fragment shorthand syntax #10291
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check this out in further detail, but are you sure this is the fix? Per the documentation this is apparently the default?
{
"plugins": [
["@babel/plugin-transform-react-jsx", {
"pragma": "dom", // default pragma is React.createElement
"pragmaFrag": "DomFrag", // default is React.Fragment
"throwIfNamespace": false // defaults to true
}]
]
}
The error went away and it started working when I made this change locally. 🤷♂️ I mentioned in the Emotion RFC for their upcoming Babel preset and Mitchell included it there. |
I've also hit this issue when upgrading and can confirm that it fixes it. Kind of weird that babel forces you to specify both instead of keeping the default value. |
Since the update to V10, the code below stopped working. Any ideas how to fix this?
Im getting this as a result
Update So i resolved the issue by changing
to
|
@t2ca that's due to a change in emotion. className isn't produced from that css call any longer. See this document for more info. |
Thank you @DSchau, I was able to find a solution! |
|
* master: (1595 commits) chore: update link for react-gatsby-firebase-authentication (gatsbyjs#10314) fix(www): Awesome Gatsby sidebar link (gatsbyjs#10313) Add thijs koerselman to creators list (gatsbyjs#10303) chore(release): Publish fix(gatsby-plugin-emotion): allow for React.Fragment shorthand syntax (gatsbyjs#10291) feat(www): Update starter cards (gatsbyjs#10258) Update index.md (gatsbyjs#10307) Update index.md (gatsbyjs#10306) Add thijs koerselman portfolio to sites list (gatsbyjs#10304) chore(release): Publish fix(gatsby): don't remount matchPath pages (gatsbyjs#10261) chore(release): Publish feat(gatsby-source-contentful): enable RichText for all users (gatsbyjs#10301) docs(tutorial): update 404 screenshot (gatsbyjs#10295) feat(gatsby-plugin-typescript): allow specifying babel preset options (gatsbyjs#10248) docs(gatsby-plugin-sass): fix typo in docs (gatsbyjs#10292) fix(ci): actually only run tests on non-docs changes (gatsbyjs#10287) fix(blog): rename for correct date in link (gatsbyjs#10290) Adds a more descriptive link purpose (gatsbyjs#9266) fix(www): comment out down showcase site ...
* master: (870 commits) fix(graphql-skip-limit): declare `graphql` peer dependency (gatsbyjs#10305) fix(gatsby-plugin-offline): gracefully degrade if appshell isn't precached (gatsbyjs#10329) Service workers note (gatsbyjs#10276) fix(docs): link fixes, podcast addition (gatsbyjs#10332) feat(docs): Create clearer pathways in docs (gatsbyjs#9898) feat(www): Rename community section to creators (gatsbyjs#10312) docs(graphql-reference): clarify filtering using comma/and operator (gatsbyjs#10321) chore(release): Publish feat(gatsby-plugin-sass): Support Dart SASS (gatsbyjs#10159) fix(gatsby-source-drupal): use basic auth credentials to fetch remote files as well. (gatsbyjs#10302) fix(gatsby-source-filesystem): allow empty password for basic auth in createRemoteFileNode (gatsbyjs#10280) docs(gatsby-remark-prismjs): Use Gatsby V2 project structure (gatsbyjs#10059) chore: update link for react-gatsby-firebase-authentication (gatsbyjs#10314) fix(www): Awesome Gatsby sidebar link (gatsbyjs#10313) Add thijs koerselman to creators list (gatsbyjs#10303) chore(release): Publish fix(gatsby-plugin-emotion): allow for React.Fragment shorthand syntax (gatsbyjs#10291) feat(www): Update starter cards (gatsbyjs#10258) Update index.md (gatsbyjs#10307) Update index.md (gatsbyjs#10306) ...
…gatsbyjs#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 ```
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 andgatsby-plugin-emotion
v3: