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
When I use the as property to change the base element of a polymorphic component, the type of ref does not update properly. This seems like a bug to me, so I would like some confirmation.
constinputRef=useRef<HTMLInputElement>(null);return(<Combobox.Button// Type 'RefObject<HTMLInputElement>' is not assignable to type 'Ref<HTMLButtonElement> | undefined'ref={inputRef}as="input"type="button"value={selectedPerson}/>);
Also, I'm just using an any assertion to satisfy the compiler. Is there a cleaner workaround for this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When I use the
as
property to change the base element of a polymorphic component, the type ofref
does not update properly. This seems like a bug to me, so I would like some confirmation.Also, I'm just using an
any
assertion to satisfy the compiler. Is there a cleaner workaround for this?Full example: CodeSandbox
Beta Was this translation helpful? Give feedback.
All reactions