The reason for asking this question was to understand performance impact of styled components , So as I have noticed and this is my opinion , that as styled components inject styles in DOM directly via tag ,and does not affect performance that much because even though CSS is written in JavaScript which increases bundle size but that does not matter anyways because browser caches the javascript file and only first time it would affect when file is downloaded , and if not CSS in JS then styles/css file would take that size instead of js file Only issue could be processing of injecting styles in DOM , but somewhere you have to compromise to gain some benefits because its also a JS library like others(提出这个问题的原因是为了了解样式化组件的性能影响,因此,正如我所注意到的,这是我的观点,即当样式化组件通过标记直接在DOM中注入样式时,它不会对性能产生太大影响,因为即使CSS是用JavaScript编写,可以增加包的大小,但这没关系,因为浏览器会缓存javascript文件,并且只有在第一次时才会影响下载文件的时间,如果不是JS中的CSS,那么styles / css文件将采用该大小而不是js文件唯一的问题可能是在DOM中处理注入样式,但是您必须在某个地方妥协以获取一些好处,因为它也像其他JS库一样)
Also with code splitting bundle size divides,(同样,通过代码拆分包大小划分,)
ask by Vaibhav Mittal translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…