fix: upgrade Radix UI packages and tighten asChild prop types#28416
Open
himself65 wants to merge 8 commits intocalcom:mainfrom
Open
fix: upgrade Radix UI packages and tighten asChild prop types#28416himself65 wants to merge 8 commits intocalcom:mainfrom
himself65 wants to merge 8 commits intocalcom:mainfrom
Conversation
sahitya-chandra
previously approved these changes
Mar 14, 2026
Member
sahitya-chandra
left a comment
There was a problem hiding this comment.
@himself65 CI checks failed, Can you please fix them?
Radix UI's `asChild` uses `Slot` which calls `React.cloneElement` on children. This crashes when children is null, undefined, a string, or a fragment. The root cause is that these props were typed as `React.ReactNode` (which allows primitives) but `asChild` requires exactly one `React.ReactElement`. Changed types: - Tooltip: `children: ReactNode` → `ReactElement` - TableActions: `actionTrigger?: ReactNode` → `ReactElement` - AnimatedPopover: `Trigger?: ReactNode` → `ReactElement` - Avatar: `fallback?: ReactNode` → `ReactElement` This makes TypeScript catch invalid callers at compile time instead of crashing at runtime.
Radix UI v1.0.x uses `element.ref` which was removed in React 19, causing "Accessing element.ref was removed in React 19" warnings. Upgrade all @radix-ui packages to latest versions which use `React.forwardRef` properly and support React 18 + 19. Packages upgraded: - react-tooltip: 1.0.6 → 1.2.8 - react-popover: 1.0.6 → 1.1.15 - react-dialog: 1.0.4 → 1.1.15 - react-dropdown-menu: 2.0.5 → 2.1.16 - react-avatar: 1.1.3 → 1.1.11 - react-collapsible: 1.0.3 → 1.1.12 - react-hover-card: 1.0.7 → 1.1.15 - react-checkbox: 1.0.4 → 1.3.3 - react-portal: 1.0.4 → 1.1.10 - react-select: 0.1.1 → 2.2.6 - react-slider: 1.2.2 → 1.3.6 - react-switch: 1.1.0 → 1.2.6 - react-toggle-group: 1.0.4 → 1.1.11 - react-radio-group: 1.1.3 → 1.3.8 - react-id: 1.0.1 → 1.1.1
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Remove Fragment wrapper in Avatar fallback for asChild compatibility - Revert AnimatedPopover Trigger type to ReactNode (not passed to asChild) - Add missing @radix-ui/react-dropdown-menu and react-tooltip deps to @calcom/ui - Fix children type in Tooltip wrapper components to ReactElement
87001c0 to
fd3f267
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@radix-ui/*packages to latest versions (React 19 compatible)children/trigger/fallbackprop types fromReactNodetoReactElementon components that pass them to Radix'sasChildProblem
Radix UI v1.0.x internally accesses
element.ref, which was removed in React 19. This produces the warning:Additionally, several components accept
ReactNodefor props that get passed to Radix'sasChild(which callsReact.cloneElement). Passing null, strings, or fragments crashes at runtime.Changes
Radix upgrades (
apps/web/package.json,packages/ui/package.json):Type fixes (4 files):
Tooltip.tsx:children: ReactNode→ReactElementTableActions.tsx:actionTrigger?: ReactNode→ReactElementAnimatedPopover.tsx:Trigger?: ReactNode→ReactElementAvatar.tsx:fallback?: ReactNode→ReactElementMissing dep: Added
@radix-ui/react-label(was previously hoisted transitively)