We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import { styled }
import styled
System: OS: macOS 14.1 CPU: (8) arm64 Apple M1 Pro Memory: 142.03 MB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node npm: 9.6.7 - ~/.nvm/versions/node/v18.17.0/bin/npm Browsers: Chrome: 117.0.5938.132 Edge: 119.0.2151.46 Firefox: 119.0 Safari: 17.1 Safari Technology Preview: 17.4
swc-project/plugins#225
Update swc dependencies.
swc
With styled-components v6 the import syntax of import { styled } from 'styled-components' is now possible (and even preferred).
styled-components
import { styled } from 'styled-components'
swc's styled-components plugin was updated to support this. Looks like rspack also uses this feature via swc.
rspack
No response
Create a styled component with import { styled } syntax
import { styled } from 'styled-components'; const Styled = styled.div` font-size: 10000px; `; export const Component = () => <Styled />
With this additional configuration for rspack:
rspackExperiments: { styledComponents: { displayName: true, ssr: true, }, },
Result: no display name prefixed on <div class="sc-329ontheas"></div>
<div class="sc-329ontheas"></div>
The text was updated successfully, but these errors were encountered:
It seems to be a bug in @swc/plugin-styled-components. swc-project/plugins#224
@swc/plugin-styled-components
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
System Info
System:
OS: macOS 14.1
CPU: (8) arm64 Apple M1 Pro
Memory: 142.03 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.0/bin/npm
Browsers:
Chrome: 117.0.5938.132
Edge: 119.0.2151.46
Firefox: 119.0
Safari: 17.1
Safari Technology Preview: 17.4
Details
swc-project/plugins#225
Update
swc
dependencies.With
styled-components
v6 the import syntax ofimport { styled } from 'styled-components'
is now possible (and even preferred).swc
'sstyled-components
plugin was updated to support this. Looks likerspack
also uses this feature viaswc
.Reproduce link
No response
Reproduce Steps
Create a styled component with
import { styled }
syntaxWith this additional configuration for rspack:
Result: no display name prefixed on
<div class="sc-329ontheas"></div>
The text was updated successfully, but these errors were encountered: