menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

styled-components

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress!

Channels
Team

Performance issues with styled components

August 18, 2021 at 10:13am

Performance issues with styled components

August 18, 2021 at 10:13am
When doing some React profiling on my Chrome DevTools, I see some styled components taking up to 100ms to run.
This is so weird, since they don't have complex code at all.
Here you can see a codesandbox with the component Spinner, which is actually running on our app and it takes more than 80ms to run.
If I remove the ${props => getType(props)}; line, then it drops to only 6ms.

August 18, 2021 at 10:46am
I suspect from the import of gifs...
Could that be a big performance issue?