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

SlotClone should not be passed a ref if it is a React.Fragment #3224

Open
terrymun opened this issue Nov 12, 2024 · 1 comment
Open

SlotClone should not be passed a ref if it is a React.Fragment #3224

terrymun opened this issue Nov 12, 2024 · 1 comment

Comments

@terrymun
Copy link

Bug report

Current Behavior

Consuming <Dialog.Portal> (and likely other components that uses <SlotClone> under the hood)) will cause the following error to be thrown when using Next.js 15:

Invalid prop ref supplied to React.Fragment

Screenshot 2024-11-12 at 22 08 17

Expected behavior

Using <Dialog.Portal> should not be causing this error.

Reproducible example

TBD

Suggested solution

We should probably avoid passing ref to <SlotClone> component if it is a React Fragment:

<SlotClone {...slotProps} ref={forwardedRef}>

<SlotClone {...slotProps} ref={forwardedRef}>

Additional context

n.a.

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-dialog 1.1.2
React n/a 19 RC
Browser Chrome 130.0.6723.117
Assistive tech n/a n/a
Node n/a 20.17.0
pnpm n/a 9.12.3
Operating System macOS 15.1 (24B83)
@terrymun
Copy link
Author

This seems to be related to #3211

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

No branches or pull requests

1 participant