Bug report
Since updating to React 19, and changing MutableRefObject to RefObject, the following error gets raised by Radix Popover
Current Behavior
const ref = useRef<HTMLDivElement>(null);
return (
<>
<div ref={ref} />
<RadixPopover.Root open>
<RadixPopover.Anchor virtualRef={ref}>
</RadixPopover.Root>
</>
);
Type 'RefObject<HTMLDivElement | null>' is not assignable to type 'RefObject<Measurable>'.
Type 'HTMLDivElement | null' is not assignable to type 'Measurable'.
Type 'null' is not assignable to type 'Measurable'.ts(2322)
Expected behavior
Refs returned by useRef() should be usable as a virtualRef
Suggested solution
Update the virtualRef type to RefObject<Measurable | null>
Additional context
Your environment
| Software |
Name(s) |
Version |
| Radix Package(s) |
|
1.1.14 |
| React |
n/a |
19.1.0 |
| Browser |
|
|
| Assistive tech |
|
|
| Node |
n/a |
|
| npm/yarn/pnpm |
|
|
| Operating System |
|
|
Bug report
Since updating to React 19, and changing
MutableRefObjecttoRefObject, the following error gets raised by Radix PopoverCurrent Behavior
Expected behavior
Refs returned by
useRef()should be usable as avirtualRefSuggested solution
Update the
virtualReftype toRefObject<Measurable | null>Additional context
Your environment