Packages

styled-components

6.6.0 · 12 Oct 2026MIT14.8M / weekRepositoryHomepagenpmAtom feed

Your version

6.3.7

16 Jan 2026Where it was published

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:

    1. 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.

    2. StrictMode-aware cleanup: Style cleanup now uses queueMicrotask to coordinate with React's effect lifecycle. In StrictMode's simulated unmount/remount cycle, styles are preserved. On real unmount, styles are properly removed.

    3. RSC compatibility: Move useRef inside RSC guard in createGlobalStyle and unify all useContext calls to use consistent !IS_RSC ? pattern.

    4. RSC inline style tag cleanup: Fix bug where server-defined createGlobalStyle rendered 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 createGlobalStyle works correctly with:

    • React StrictMode's double-render behavior

    • React 18/19's concurrent rendering features

    • React 19's style hoisting with the precedence attribute

    • React 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.