DEV Community

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

Collapse
 
mahmoudjbor profile image
MahmoudJbor

Thanks christopher for the post.
but do you think that one of disadvantages of styled components is inspecting the styles in browsers dev tools, i find it difficult to follow up, what do you think?
BTW i'm new to styles components

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

🤯🤩