-
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
Using styled jsx tag in a React.Fragment breaks zeit/next's HMR #425
Comments
Is there currently a workaround for this? I don't want to create a wrapper |
This might not be an issue with styled-jsx but with HMR, maybe due to how re-rendering happens with Fragments and the fact that the elements (div and style tags) are siblings. In reality it seems that the issue is that with HMR I tried to change the For what is worth, looking at your example you could just nest the styles inside of the |
@timneutkens probably you have more experience with HMR ^ |
Same issue, but the error I see is:
|
@jaydenseric usually that means that you component was not transpiled at all |
Oh please, I did a search before open #4246. I've just upgrade from next 5.1 to 6. I swear I don't have any wrong syntax or empty style jsx. I even never use React.Fragment |
you can reproduce this issue with a new project using this "dependencies": { |
This is so annoying. I use style jsx for all the css code in my components. And I am getting this error every time. |
I fixed the error reinstalling [email protected] instead 6.00 |
Good news I tracked down the source of the issue to react-hot-loader v4. I'll work with the Next.js folks to fix this asap :) |
Fixes vercel/styled-jsx#425 Fixes vercel#4246 Fixes vercel#4273
Fixes vercel/styled-jsx#425 Fixes #4246 Fixes #4273
This is fixed in |
I'm using |
Fixes vercel/styled-jsx#425 Fixes vercel#4246 Fixes vercel#4273
Expected Behavior
Editing
stlye jsx
styles resting inReact.Fragment
should work withnext
's HMR, espcially asnext
ships withstyled-jsx
per default.Current Behavior
When I put a
style jsx
tag into aReact.Fragment
and change astyle jsx
css property, the page reloads with HMR, but then I get the error:When I replace
React.Fragment
withdiv
it works fineSteps to Reproduce (for bugs)
I started with the with-styled-jsx-scss:
npx create-next-app --example with-styled-jsx-scss with-styled-jsx-scss-app
yarn install
,yarn run dev
localhost:3000
background-color
insrc/components/Canvas.jsx
Your Environment
The text was updated successfully, but these errors were encountered: