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
The fix in #15687 did not get the original issue resolved, now that we have the apparent type, we can not spread T into a Component<T>.
here are a few samples:
import*asReactfrom"react";constdecorator=function<T>(Component: React.StatelessComponent<T>): React.StatelessComponent<T>{return(props)=><Component{...props}></Component>// should be ok};constdecorator2=function<Textends{x: number}>(Component: React.StatelessComponent<T>): React.StatelessComponent<T>{return(props)=><Component{...props}x={2}></Component>// Should be ok, x is known};constdecorator4=function<Textends{x: number}>(Component: React.StatelessComponent<T>): React.StatelessComponent<T>{return(props)=><Component{...props}y={"blah"}></Component>// Should be an error, unknown y};
The text was updated successfully, but these errors were encountered:
The fix in #15687 did not get the original issue resolved, now that we have the apparent type, we can not spread
T
into aComponent<T>
.here are a few samples:
The text was updated successfully, but these errors were encountered: