styled-components / babel-plugin-styled-components

Improve the debugging experience and add server-side rendering support to styled-components
MIT License
1.07k stars 141 forks source link

redundant imports cause default-export version to not be transformed #392

Open gregorjan opened 1 year ago

gregorjan commented 1 year ago

When using named import from styled-components both babel and swc plugins are not used.

image

Funnily enough in codesandbox the behavior is exact opposite

Environment

System:

Reproduction

https://codesandbox.io/p/sandbox/jolly-haze-sf21k4

Steps to reproduce

Use babel-plugin-styled-components and named import from styled-components package

Expected Behavior

displayName is correctly added to class

Actual Behavior

displayName is not added to class

quantizor commented 1 year ago

When using named import from styled-components both babel and swc plugins are not used.

Actually looking at your sandbox, it looks like only the button using the named import worked... I wonder if the plugin can handle one or the other but not both.