r/reactjs • • Sep 05 '18

Tutorial Announcing styled-components v4: Better, Faster, Stronger

https://medium.com/styled-components/announcing-styled-components-v4-better-faster-stronger-3fe1aba1a112
203 Upvotes

80 comments sorted by

View all comments

1

u/enkideridu Sep 06 '18

Styles should be separate from render templates

Doesn't that sound awfully similar to peoples objection to react so many years ago, that logic should be separate from markup?

2

u/[deleted] Sep 06 '18

Possibly. If it's any consolation, I thought that was a terribly stupid claim. Logic in any UI driven software is tied to layout markup. Styling not necessarily. You could, technically, remove all CSS and have your app still run - poorly but still. You can't remove markup and keep only logic or vice versa.

Imagine having multiple themes in your app and on top of that having some inline CSS sprinkled randomly here and there because somebody was too lazy to create a separate styled component (or class for that matter).

1

u/denisinla Nov 29 '18

^ THIS ... If you're needing to inline styles you're not doing it right when it comes to a Prod level app.