DEV Community

Discussion on: Styled components: what, why and how?

Collapse
 
christopherkade profile image
Christopher Kade • Edited

This is a common problem with styled components so thank you for bringing it up.

A solution would be to use the plugin mentioned here: styled-components.com/docs/tooling

It will display named classes instead of the randomly generated ones, so <button class="asdf123" /> would be <button class="Button-asdf123 asdf123" /> ! 😄

Collapse
 
itsjzt profile image
Saurabh Sharma • Edited

the real problem is you need to eject create-react-app for it 😁

Thread Thread
 
christopherkade profile image
Christopher Kade

That's definitely a problem, it seems like the babel macro feature would allow us to use it without ejecting our app: styled-components.com/docs/tooling...

Thread Thread
 
itsjzt profile image
Saurabh Sharma

🤯🤩