-
Notifications
You must be signed in to change notification settings - Fork 261
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
Error in fragment #458
Comments
styled-jsx is not compatible with Babel7 yet but it would probably as simple as also visiting |
Any update on this? And is the incompatibility with Babel 7 documented anywhere? Just lost hours trying to debug this before figuring out it was the new Fragment syntax that was causing it. |
As styled-jsx doesn't yet support it: vercel/styled-jsx#458
Can this please be escalated to bug status? It makes no sense that this will work: import { Fragment } from 'react'
const Logo = () => (
<Fragment>
<img src="/static/logo.svg" />
<style jsx>{`
img {
border-radius: 50%;
}
`}</style>
</Fragment>
) ... and this legitimate syntax (supported by stable React and Babel) won't: const Logo = () => (
<>
<img src="/static/logo.svg" />
<style jsx>{`
img {
border-radius: 50%;
}
`}</style>
</>
) |
We need to make a patch release before starting to work on v4 and switch to babel 7. I don’t do this for a living so sometimes things can be slower. If any bugfix or feature is crucial for your work I welcome any contribution and I’d be happy to give guidance and help |
A heads up (see referenced issue above) that this bug resurfaced when using the |
and added support for React Fragments (fixes vercel#458)
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
Styled JSX inside a React Fragment container causes a rendering error.
If the current behavior is a bug, please provide the steps to reproduce and possibly a minimal demo or testcase in the form of a Next.js app, CodeSandbox URL or similar
Mounting this component:
Causes this error:
What is the expected behavior?
No rendering error.
Environment (include versions)
Did this work in previous versions?
There were other bugs with fragments which have since been closed.
The text was updated successfully, but these errors were encountered: