# v3.0.0-alpha.35 **Category**: react **URL**: https://www.heroui.com/docs/react/releases/v3-0-0-alpha-35 **Source**: https://raw.githubusercontent.com/heroui-inc/heroui/refs/heads/v3/apps/docs/content/docs/react/releases/v3-0-0-alpha-35.mdx > React Server Components support for compound components, React 19 improvements, and critical bug fixes. ***
October 21, 2025
This release fixes a critical issue where **compound components didn't work correctly in React Server Components (RSC)**. Additionally, this release adopts React 19 best practices by removing `forwardRef` and simplifying context usage. The Switch component has been refactored to match the Radio/RadioGroup pattern, providing a cleaner and more consistent API. ## Installation Update to the latest version: ```bash npm i @heroui/styles@alpha @heroui/react@alpha ``` ```bash pnpm add @heroui/styles@alpha @heroui/react@alpha ``` ```bash yarn add @heroui/styles@alpha @heroui/react@alpha ``` ```bash bun add @heroui/styles@alpha @heroui/react@alpha ``` **Using AI assistants?** Simply prompt "Hey Cursor, update HeroUI to the latest version" and your AI assistant will automatically compare versions and apply the necessary changes. Learn more about the [HeroUI MCP Server](/docs/ui-for-agents/mcp-server). ## What's New ### React Server Components Support Compound components now work correctly in React Server Components. The previous implementation had the compound pattern logic inside components, which conflicted with the `"use client"` directive. This has been fixed by moving the pattern logic to component index files. ### React 19 Improvements This release adopts React 19 best practices: 1. **Removed `forwardRef`**: No longer needed in React 19, where `ref` is now a prop ([React 19 docs](https://react.dev/blog/2024/12/05/react-19#ref-as-a-prop)) 2. **Simplified Context**: `Context.Provider` replaced with just `Context` ([React 19 docs](https://react.dev/blog/2024/12/05/react-19#context-as-a-provider)) ### Switch Component Architecture Improvement The Switch component has been refactored to follow the same clean separation pattern as Radio/RadioGroup: - **Separate Components**: Switch and SwitchGroup are now independent components (previously combined) - **Cleaner API**: `` replaces the nested `` and `` pattern - **Better Organization**: Separate styles, types, and implementations for each component - **Consistent Pattern**: Matches the Radio/RadioGroup architecture for a more predictable API **Before:** ```tsx ... ``` **After:** ```tsx ... ... ``` ## ⚠️ Breaking Changes ### Main Component Requires `.Root` Suffix To support React Server Components, the compound component pattern has been restructured. The main component now requires the `.Root` suffix when using the compound pattern. **Before:** ```tsx import { Avatar } from "@heroui/react" JR ``` **After:** ```tsx import { Avatar } from "@heroui/react" JR ``` **Note:** Named exports (e.g., ``, ``, ``) remain unchanged and fully supported. ### Switch Component API Changes The Switch component grouping API has been restructured to match the Radio/RadioGroup pattern: **Before:** ```tsx import { Switch } from "@heroui/react" ``` **After:** ```tsx import { Switch, SwitchGroup } from "@heroui/react" ``` This change helps to: - **Separate Components**: Switch and SwitchGroup are now independent components (previously combined) - **Cleaner API**: `` replaces the nested `` and `` pattern - **Better Organization**: Separate styles, types, and implementations for each component - **Consistent Pattern**: Matches the Radio/RadioGroup architecture for a more predictable API **Migration Steps:** 1. Import `SwitchGroup` separately: `import { Switch, SwitchGroup } from "@heroui/react"` 2. Replace `` with `` 3. Remove the nested `` wrapper 4. Individual `Switch.Root` components remain unchanged #### Affected Components All compound components are affected: - `Accordion` → `Accordion.Root` - `Avatar` → `Avatar.Root` - `Card` → `Card.Root` - `Disclosure` → `Disclosure.Root` - `Fieldset` → `Fieldset.Root` - `Kbd` → `Kbd.Root` - `Link` → `Link.Root` - `Popover` → `Popover.Root` - `RadioGroup` → `RadioGroup.Root` - `Switch` → `Switch.Root` - `Tabs` → `Tabs.Root` - `Tooltip` → `Tooltip.Root` ## Migration Guide You have two options for using HeroUI compound components: ### Option 1: Update to Use `.Root` (Compound Pattern) If you're using the compound pattern (dot notation), update your code to use `.Root` for the main component: **Card Example:** ```tsx import { Card } from "@heroui/react" Card Title Card description Card content Card footer ``` **Tabs Example:** ```tsx import { Tabs } from "@heroui/react" Tab 1 Tab 2 Panel 1 Panel 2 ``` [See more examples in the documentation](/docs/components/card) **Avatar Example:** ```tsx import { Avatar } from "@heroui/react" JD ``` [See more examples in the documentation](/docs/components/avatar) ### Option 2: Use Named Exports We added support for named exports for all compound components. You can use them like this: **Card Example:** ```tsx import { CardRoot, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, } from "@heroui/react" Card Title Card description Card content Card footer ``` **Tabs Example:** ```tsx import { TabsRoot, TabListContainer, TabList, Tab, TabIndicator, TabPanel } from "@heroui/react" Tab 1 Tab 2 Panel 1 Panel 2 ``` **Avatar Example:** ```tsx import { Avatar, AvatarImage, AvatarFallback } from "@heroui/react" JD ``` ### Migration Steps If you're using the compound pattern, you only need to update the main component to use `.Root`: 1. **Find all instances of compound components** (e.g., `` with `` inside) 2. **Add `.Root` to the main component**: ```tsx // Before // After ``` 3. **That's it!** All child components (e.g., `Avatar.Image`, `Avatar.Fallback`) remain unchanged. ### Complete Migration Reference | Component | Named Export Pattern | Compound Pattern (with `.Root`) | Additional Changes | |-----------|---------------------|---------------------|---------------------| | **Accordion** | `` | `` | - | | **Avatar** | `` | `` | - | | **Card** | `` | `` | - | | **Disclosure** | `` | `` | - | | **Fieldset** | `
` | `` | - | | **Kbd** | `` | `` | - | | **Link** | `` | `` | - | | **Popover** | `` | `` | - | | **Radio** | `` | `` | - | | **Switch** | ``, `` | ``, `` | `` → `` (separate component) | | **Tabs** | ``, `` | ``, `` | - | | **Tooltip** | ``, `` | ``, `` | - | ### Automated Migration For large codebases using the compound pattern, you can use find-and-replace: ```bash # Example for Avatar component # Update the main component to use .Root sed -i 's///g' **/*.tsx sed -i 's/<\/Avatar>/<\/Avatar.Root>/g' **/*.tsx # Switch component requires additional steps # First, ensure SwitchGroup is imported # Then replace Switch.Group with SwitchGroup sed -i 's//<\/SwitchGroup>/g' **/*.tsx # Remove Switch.GroupItems wrapper sed -i 's///g' **/*.tsx sed -i 's/<\/Switch\.GroupItems>//g' **/*.tsx # Repeat for other compound components (Card, Tabs, etc.) # Note: This only affects files using the compound pattern ``` **Important:** - Be careful with automated replacements. Make sure you're only replacing compound pattern usage, not named exports. - For Switch migrations, verify that `SwitchGroup` is imported: `import { Switch, SwitchGroup } from "@heroui/react"` - Test your code after running automated migrations to ensure all changes are correct. ## Why This Change? This change was necessary to fix React Server Components compatibility. The previous implementation had architectural limitations: 1. **RSC Compatibility**: Compound pattern logic conflicted with `"use client"` directives 2. **React 19 Readiness**: Removes deprecated patterns like `forwardRef` and `Context.Provider` 3. **Cleaner Architecture**: Pattern logic is now in index files, not component files 4. **Better Separation**: Server and client components can now work together seamlessly ## Documentation Updates Component documentation will be updated to reflect the new patterns: - Examples will show the compound pattern with `.Root` - Named export examples remain valid and supported - Migration guides will help you transition smoothly - Both patterns are fully supported and work identically ## Need Help? If you encounter any issues during migration: 1. **Compound pattern users**: Update the main component to use `.Root` (e.g., `` → ``) 2. **Named export users**: No changes needed - your code continues to work as-is 3. Check the component documentation for examples 4. Report issues at: [GitHub Issues](https://github.com/heroui-inc/heroui/issues) ## Links - [Component Documentation](/docs/react/components) - [React Server Components](https://react.dev/reference/rsc/server-components) - [React 19 Release](https://react.dev/blog/2024/12/05/react-19) - [GitHub Repository](https://github.com/heroui-inc/heroui) ## Contributors Thanks to everyone who contributed to this release, improving React Server Components support and React 19 compatibility!