3 ms·
We've tried styled-components in medium-size projects (50-500 components) and haven't noticed any performance-hit yet. That being said, it's definitely somethin
by mxstbr 10y ago
We've tried styled-components in medium-size projects (50-500 components) and haven't noticed any performance-hit yet. That being said, it's definitely something we're conscious about.
That's why we will be writing a babel transform that grabs all the _static_ styles and extracts them into a separate stylesheet! (just didn't have time to do it until ReactNL where I just announced it)
See this issue for more information, and if anybody reading this has experience with babel transforms please holla since we can definitely use your help! https://github.com/styled-components/styled-components/issues/59 https://github.com/styled-components/styled-components/issue...
- onetom 10y agoYou mean extract into a separate stylesheet file? Wouldn't that lead to https://en.wikipedia.org/wiki/Flash_of_unstyled_content https://en.wikipedia.org/wiki/Flash_of_unstyled_content issues? Maybe some memoization could help if there are performance issues with regenerating `document.styleSheets`...