Tom Smykowski
1 min readDec 5, 2020

--

Styled components are an interesting solution to a problem of CSS encapsulation. But it comes with disadvantages. Having CSS inside a component file breaks the rule of separation of concerns leading to having presentation and logic in one place. It is better than having styles inlined but worse that separate file. Angular or Ember encapsulate styles automatically so there is no need for any workarounds with it.

If it comes to hooks and functions — it an interesting idea too, and still wonder if in a long term React will pull it off. Making function act as a class while pretending it is not a class. Compared to previous solutions inside React it is a relief, but on the other hand Angular uses classes and dependency injection solves most of the problems hooks try to solve.

Aside from that article is great and thank you for it. It was an interesting read

--

--

Tom Smykowski
Tom Smykowski

Written by Tom Smykowski

🚀 Senior/Lead Frontend Engineer | Angular · Vue.js · React | Design Systems, UI/UX | Looking for a new project! 📩 contact@tomasz-smykowski.com

No responses yet