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
with the following usage of forwardRef union types get lost:
interfaceProps{/** The name to greet */name: "world"|"hello";title: string;}/** * Hello world component */constMyComponent=forwardRef<ElementRef<"div">,Props>(({name ='world'},ref)=>{return<div/>;
});
A workaround is to add the type "Props to the spread as well:
interfaceProps{/** The name to greet */name: "world"|"hello";title: string;}/** * Hello world component */constMyComponent=forwardRef<ElementRef<"div">,Props>(({name ='world'}: Props,ref)=>{return<div/>;
});
But this is redundant because the type is already defined as a generic at the forwardRef function.
Would it be possible to support the generics of forwardRef?
Thanks in regards
The text was updated successfully, but these errors were encountered:
Hello together,
with the following usage of forwardRef union types get lost:
A workaround is to add the type "Props to the spread as well:
But this is redundant because the type is already defined as a generic at the forwardRef function.
Would it be possible to support the generics of forwardRef?
Thanks in regards
The text was updated successfully, but these errors were encountered: