Download Latest Version styled-components@6.3.11 source code.tar.gz (285.5 kB)
Email in envelope

Get an email when there's a new version of Styled Components

Home / styled-components@6.3.7
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-01-16 1.6 kB
styled-components@6.3.7 source code.tar.gz 2026-01-16 270.4 kB
styled-components@6.3.7 source code.zip 2026-01-16 397.5 kB
Totals: 3 Items   669.6 kB 0

Patch Changes

  • 51ffa9c: 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)
  • 51ffa9c: Restore styled.br.

  • 1f794b7: Add package.json "exports" field for better native ESM integration.

Source: README.md, updated 2026-01-16