styled-components@6.3.0
Minor Changes
-
28fd502: Add React Server Components (RSC) support
styled-components now automatically detects RSC environments and handles CSS delivery appropriately:
- No
'use client'directive required: Components work in RSC without any wrapper or directive - Automatic CSS injection: In RSC mode, styled components emit inline
<style>tags that React 19 automatically hoists and deduplicates - Zero configuration: Works out of the box with Next.js App Router and other RSC-enabled frameworks
- Backward compatible: Existing SSR patterns with
ServerStyleSheetcontinue to work unchanged
RSC best practices:
- Prefer static styles over dynamic interpolations to avoid serialization overhead
- Use data attributes for discrete variants (e.g.,
&[data-size='lg']) - CSS custom properties work perfectly in styled-components, can be set via inline
style, and cascade to children:
- No