This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
SWC + styled-components: element classes & style classes are not synched #35989
Labels
bug
Issue was opened via the bug report template.
good first issue
Easy to fix issues, good for newcomers
Verify canary release
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 16.14.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.1.5-canary.4
react: 17.0.2
react-dom: 17.0.2
styled-components: 5.3.5
What browser are you using? (if relevant)
Chrome 100.0.4896.75
How are you deploying your application? (if relevant)
No response
Describe the Bug
Sometimes when passing props to styled-components component, the generated CSS class is not synched with the styles. Classes work normally when adding the basic .babelrc configuration for styled-components so I assume the problem is with SWC.
Expected Behavior
So far there has been 2 cases when classes are wrong:
To Reproduce
I created a CodeSandbox version: https://codesandbox.io/s/next-styled-components-class-names-issue-bz5p0z?file=/pages/index.js
The text was updated successfully, but these errors were encountered: