styled-components / babel-plugin-styled-components

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

displayName not working with styled-components/macro #371

Closed joshwcomeau closed 1 year ago

joshwcomeau commented 2 years ago

Hi there!

styled-components/macro allows the developer to enjoy the benefits of the displayName property without needing to tinker with a babel config / eject a create-react-app application.

Here's a CodeSandbox showing the issue: https://codesandbox.io/s/cold-flower-5orvj

Expected behavior: The <Thing> component should render as a div with class="App__Thing-sc-123abc" Actual behavior: The <Thing> component is rendering as a div with class="sc-abc123".

I checked, and this appears to have broken with the 2.0.0 release; it worked immediately previous, in 1.13.3.

Let me know if I can do anything else to help!

rockwotj commented 2 years ago

This seems to be fixed in the latest release

agriffis commented 2 years ago

@joshwcomeau Fixed in v2.0.6?

OmarKhled commented 2 years ago

it's working now in v2.0.7!