DEV Community

Discussion on: Styled components, the styling library for your React apps you don’t want to be without

Collapse
georgecoldham profile image
George

Im currently using StyledComponents in on a live product. I love it.

I feel it is worth mentioning a few issues that people need to be aware of though:

  • Bad code structure makes styled components hell to work with, huge files with somewhat disassociated code.
  • Working with existing more classic css/sass etc. can cause unforseen headaches without a clear source of the issue.
  • There isnt great support for syntax highlighting in the wild. Wrapping a component in variables can cause more syntactical fun. (Other editor issues can be here too. eg. VSCode doesnt understand it and you cant collapse the code blocks.)
  • Easy to create div hell as there is no support for react fragments.

All these problems are project/user specific, and easily avoidable. As this is picked up more, then I imagine these issues will stop being so much of an issue.

I would highly recommend checking out this library as it is amazing to use and makes the components highly readable.