Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not pass ref into SlotClone component if children is a React.Fragment #3229

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

terrymun
Copy link

Description

This PR fixes the issue with consuming any Radix UI Primitive in React 19, which will throw the following error in the console (as reported in #3224):

385466239-382e4304-6fd9-468f-a32f-778a93bd4e0f

The error seems to arise from not checking the type of the children prop, which could potentially be a React Fragment that does not accept ref prop.

Therefore, the ref prop is only conditionally added to the props of the <SlotClone> element if children is not of type React.Fragment.

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