3 ms·
The approach I've been taking is to use ReasonML to model the domain of my application as well as high level components. ReasonML code remains unaware of the st
by wwewe 6y ago
The approach I've been taking is to use ReasonML to model the domain of my application as well as high level components. ReasonML code remains unaware of the styling of the "lower-level" components for the most part, which I write in typescript with styled-components or emotion.
- chrisweekly 6y agoIs there any reason to prefer styled-components over emotion? I did a deep dive on this a few months ago, and found that Emotion supports the same API as SC, while also offering benefits like the `sx` prop, not to mention SSR for "free". It also had a reputation for being faster, but I didn't bother to benchmark it.
- thegreatpeter 6y agoI'm bias as a contributor but Emotion does offer those perks "for free". Emotion has had a track record of quality engineering - Kye pioneered the babel plugin idea in its early days.
- davesnx 6y agoSC and the styled API from emotion are identical syntactic-wise and performance-wise. SC used to suffer from performance and big bundle size but these last 2 versions are very balanced. The same way as the sx prop from Emotion it's the css prop from styled-components. Just to clarify and sell a little my ppx, styled-ppx supports the css prop as well, many people prefer that over the component api.