admin管理员组文章数量:1289845
Does the ReactJS virtual DOM make your app faster if you put all CSS as inline style? VS using raw .css files?
.html
Also see this ReactJS presentation on CSS in JavaScript:
Does the ReactJS virtual DOM make your app faster if you put all CSS as inline style? VS using raw .css files?
http://facebook.github.io/react/tips/inline-styles.html
Also see this ReactJS presentation on CSS in JavaScript: https://speakerdeck./vjeux/react-css-in-js
Share Improve this question asked Feb 22, 2015 at 4:06 Giant ElkGiant Elk 5,6859 gold badges46 silver badges57 bronze badges 2- Possibly related (also interesting reading) stackoverflow./questions/8284365/… – mattsven Commented Feb 22, 2015 at 4:13
- found this interesting jsperf stuff jsperf./js-inline-css-vs-stylesheet-one-at-a-time/2 Results say that stylesheets is faster than inline – Dhiraj Commented Feb 22, 2015 at 4:14
1 Answer
Reset to default 13Browsers have put years of efforts into making their CSS stylesheet parsing + rendering engines blazing fast and memory efficient. Inline styles haven't exactly had that same treatment. However the bright side is that it actually doesn't matter much if you're creating normal-sized apps/pages. The difference is miniscule. Inline styles make up for the fact that 100% of the styles are actually used, where CSS stylesheets are often concatenated and almost 90% of the parsed rules are inactive (wasted).
Tip: Improve your performance by avoiding React re-renders. That's where the bottleneck often really is!
本文标签: javascriptWhat is fasterraw CSS or inline styles in ReactJSStack Overflow
版权声明:本文标题:javascript - What is faster, raw CSS or inline styles in ReactJS? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741422988a2377911.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论