3 ms·
CSS-in-JS is a far more pervasive issue IMO. SVG-in-JS has a definite performance cost, but it's not an anti-pattern.
by joduplessis 3y ago
CSS-in-JS is a far more pervasive issue IMO. SVG-in-JS has a definite performance cost, but it's not an anti-pattern.
- willio58 3y agoWe do this at my job. Do you have any good articles that describe clearly why this is bad? On the surface I assume it’s because you need to load all the js, create the dom, and then apply css in that order instead of just having a separate file for css loaded quickly at the beginning and letting the dom load in after. But is there a benefit to css in js where only the css used in the components your rendering is loaded? Like an automatic code splitting for css?