Skip to content

Conversation

@jjenzz
Copy link
Contributor

@jjenzz jjenzz commented Oct 6, 2025

Description

This is inspired by #2197 and should resolve #3626, but I've made it backwards compatible and also improved the implementation of Slot slightly:

  • Avoids rendering redundant extra Slot.SlotClone comps
  • Replaces React.Children.only() error with a more intuitive warning
  • Adds tests including thorough use-case examples in ssr-testing

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2025

🦋 Changeset detected

Latest commit: 6e334fa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 44 packages
Name Type
@radix-ui/react-slot Patch
@radix-ui/react-alert-dialog Patch
@radix-ui/react-collection Patch
@radix-ui/react-dialog Patch
@radix-ui/react-menu Patch
@radix-ui/react-popover Patch
@radix-ui/react-primitive Patch
radix-ui Patch
@radix-ui/react-select Patch
@radix-ui/react-tooltip Patch
@radix-ui/react-accordion Patch
@radix-ui/react-menubar Patch
@radix-ui/react-navigation-menu Patch
@radix-ui/react-one-time-password-field Patch
@radix-ui/react-roving-focus Patch
@radix-ui/react-slider Patch
@radix-ui/react-toast Patch
@radix-ui/react-context-menu Patch
@radix-ui/react-dropdown-menu Patch
@radix-ui/react-announce Patch
@radix-ui/react-arrow Patch
@radix-ui/react-aspect-ratio Patch
@radix-ui/react-avatar Patch
@radix-ui/react-checkbox Patch
@radix-ui/react-collapsible Patch
@radix-ui/react-dismissable-layer Patch
@radix-ui/react-focus-scope Patch
@radix-ui/react-form Patch
@radix-ui/react-hover-card Patch
@radix-ui/react-label Patch
@radix-ui/react-password-toggle-field Patch
@radix-ui/react-popper Patch
@radix-ui/react-portal Patch
@radix-ui/react-progress Patch
@radix-ui/react-radio-group Patch
@radix-ui/react-scroll-area Patch
@radix-ui/react-separator Patch
@radix-ui/react-switch Patch
@radix-ui/react-tabs Patch
@radix-ui/react-toggle-group Patch
@radix-ui/react-toggle Patch
@radix-ui/react-toolbar Patch
@radix-ui/react-visually-hidden Patch
@radix-ui/react-accessible-icon Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jjenzz jjenzz force-pushed the slot-improvements branch from 56797c0 to 60c567c Compare October 6, 2025 15:57
Comment on lines 21 to 22
if (process.env.NODE_ENV === 'development') console.warn(createSlotWarning(ownerName));
return children;
Copy link
Contributor Author

@jjenzz jjenzz Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it cannot slot, we don't throw anymore... it renders the children as normal with a warning. I wasn't sure what was best here tbh.

@jjenzz jjenzz force-pushed the slot-improvements branch from 60c567c to e5d7103 Compare October 28, 2025 18:31
@jjenzz jjenzz force-pushed the slot-improvements branch from e5d7103 to 6e334fa Compare October 28, 2025 18:32
@jjenzz jjenzz closed this Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant