Demystifying Styled Components
joshwcomeau.com
joshwcomeau.com
Big fan of styled-components here. Feels like just the right level of abstraction over styles when working with React for me.
styled-components supports SSR (server-side rendering). Each page's HTML response from the server will contain a <style> tag which contains only the styles that were generated during the React render for the page.
https://styled-components.com/docs/advanced#server-side-rend...
And if you're not using SSR, then it probably won't matter that your CSS is blocked by your JS, since your HTML will also be blocked by your JS!
He reverse engineered the api implementing the basic functionality, https://makersden.io/blog/reverse-engineering-styled-compone...
The design department comes up with a fancy new "Leave Feedback" dialog box. Management declares that all products must include this new dialog box to maintain brand cohesion. The component is shared across teams.
If this were to happen with just <font> tags, you'd be pushing a lot of extra unused stuff to the browser every time management wants a new dialog box.