You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ref: forwardedRef ? composeRefs(forwardedRef, (children as any).props.ref ?? (children as any).ref) : (children as any).props.ref ?? (children as any).ref,
Your environment
Software
Name(s)
Version
Radix Package(s)
Any using Slot
latest
React
n/a
19.0.0-beta-6946ebe620-20240508
The text was updated successfully, but these errors were encountered:
OriginalEXE
changed the title
Fix a warning in React 19 about accessing .ref directly
Slot component causes a warning in React 19 about accessing .ref directly
May 9, 2024
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: