| Name | Modified | Size | Downloads / 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:
-
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
precedenceattribute - React Server Components (server-defined GlobalStyles in client components)
-
-
51ffa9c: Restore
styled.br. -
1f794b7: Add package.json "exports" field for better native ESM integration.