Styled-components maintenance mode: A 40% faster fork

https://news.ycombinator.com/rss Hits: 3
Summary

Your React app might be 40% slower on first render than it needs to be.Not because you wrote bad code. Not because React is slow. But because styled-components never implemented React 18's useInsertionEffect hook: a feature specifically designed to solve CSS-in-JS performance problems.While React 18 shipped in March 2022 with this optimization path, styled-components remained on React 17 patterns, injecting styles during render instead of between render and layout. This creates a performance-killing cycle: styles get injected, layout recalculates, more styles inject, more recalculations. Exactly what useInsertionEffect was designed to prevent."For new projects, I would not recommend adopting styled-components," wrote Evan Jacobs, its maintainer for the last couple of years. Clear. Direct. Honest.But what about the millions of existing components already in production?When Evan announced maintenance mode on March 17, 2025, he was refreshingly transparent: styled-components won't work in React Server Components without 'use client' directives. The ecosystem has moved on. He no longer runs styled-components in production. The React team themselves have made it clear: runtime CSS injection will always be slower than statically extracted styles. They recommend using <link rel="stylesheet"> for static styles and inline styles for dynamic values. That's the future.Respect. Maintaining a library with 34,000 stars for free is exhausting. We've been sponsoring styled-components for years. We know the burden. Evan's honesty gave everyone clarity to make decisions.But here's what that announcement didn't address: thousands of production apps with hundreds of thousands of styled components that can't just disappear. Teams at Linear, Sanity, and countless others. We all woke up to the same problem.Our codebases using styled-components don't care that Tailwind is trending (no lack of trying to make them!). They need to ship features today.Our decision? Pick up where the community ...

First seen: 2025-09-12 07:33

Last seen: 2025-09-12 09:34