-
Notifications
You must be signed in to change notification settings - Fork 873
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
Slot component causes a warning in React 19 about accessing .ref
directly
#2890
Comments
OriginalEXE
changed the title
Fix a warning in React 19 about accessing
Slot component causes a warning in React 19 about accessing May 9, 2024
.ref
directly.ref
directly
A PR is open to address this. #2811 |
Ah, didn't find it via search, thanks, eagerly watching that PR then 👀 |
Got the same issue in a
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Current Behavior
The
Slot
component accesses.ref
on the element, which seems to be a no-no in React 19. The problematic line seems to be this one:https://github.com/radix-ui/primitives/blob/main/packages/react/slot/src/Slot.tsx#L66
This results in the following warning:
Expected behavior
No warnings
Reproducible example
CodeSandbox Template
Suggested solution
I haven't tried it, but maybe something like
Your environment
The text was updated successfully, but these errors were encountered: