styled-components
6.6.0 · 12 Oct 2026MIT14.8M / weekRepositoryHomepagenpmAtom feed
6.6.0 is the newest release of 6.x.
In short
1 new2 fixed
Release note
Patch Changes
Fix createGlobalStyle compatibility with React StrictMode and RSC
This fix addresses issues where global styles would disappear or behave incorrectly in React StrictMode and RSC:
Static styles optimization: Static global styles (without props/interpolations) are now only injected once and won't be removed/re-added on every render. This prevents the style flickering that could occur during concurrent rendering.
StrictMode-aware cleanup: Style cleanup now uses
queueMicrotaskto coordinate with React's effect lifecycle. In StrictMode's simulated unmount/remount cycle, styles are preserved. On real unmount, styles are properly removed.RSC compatibility: Move
useRefinside RSC guard increateGlobalStyleand unify alluseContextcalls to use consistent!IS_RSC ?pattern.RSC inline style tag cleanup: Fix bug where server-defined
createGlobalStylerendered in client components would leave behind accumulated SSR-rendered inline<style data-styled-global>tags. The cleanup effect now removes these hoisted style tags when the component unmounts or re-renders with different CSS.
These changes ensure
createGlobalStyleworks correctly with:React StrictMode's double-render behavior
React 18/19's concurrent rendering features
React 19's style hoisting with the
precedenceattributeReact Server Components (server-defined GlobalStyles in client components)
Restore
styled.br.Add package.json "exports" field for better native ESM integration.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.