4 ms·
> Just put your CSS in a .css file where it can be cached, delivered by CDNs .js files are cached and delivered by CDNs too. > can easily be edited in a singl
by ggregoire 8y ago
> Just put your CSS in a .css file where it can be cached, delivered by CDNs
.js files are cached and delivered by CDNs too.
> can easily be edited in a single place
If you change the name of a class (or add a new one, delete another one, edit the structure of the component, etc...), then you have to open and edit 2 files. With author's solution you don't. The CSS is collocated with the component.
> Separation of content and presentation has been around for a good reason. One should always avoid mixing logic and design
Author is talking about putting the React component (presentation) and its CSS (presentation) in the same file. He's not mixing business logic and design.
- pmlnr 8y ago> .js files are cached and delivered by CDNs too. Not in 2019, in the age of excessive A/B testing, where every page load gives you a different set of JS.