@@ -6,7 +6,7 @@ import * as React from 'react';
66
77const myHoc = <ComposedComponentProps extends any>(
88>myHoc : <ComposedComponentProps extends unknown>(ComposedComponent: React.ComponentClass<ComposedComponentProps, any>) => void
9- ><ComposedComponentProps extends any>( ComposedComponent: React.ComponentClass<ComposedComponentProps>,) => { type WrapperComponentProps = ComposedComponentProps & { myProp: string }; const WrapperComponent: React.ComponentClass<WrapperComponentProps> = null as any; const props: ComposedComponentProps = null as any; // Expected no error, got none - good <WrapperComponent {...props} myProp={'1000000'} />; // Expected error, but got none - bad! <WrapperComponent {...props} myProp={1000000} />;} : <ComposedComponentProps extends unknown>(ComposedComponent: React.ComponentClass<ComposedComponentProps, any>) => void
9+ ><ComposedComponentProps extends any>( ComposedComponent: React.ComponentClass<ComposedComponentProps>,) => { type WrapperComponentProps = ComposedComponentProps & { myProp: string }; const WrapperComponent: React.ComponentClass<WrapperComponentProps> = null as any; const props: ComposedComponentProps = null as any; // Expected no error caused by "myProp" , got none - good <WrapperComponent {...props} myProp={'1000000'} />; // Expected error caused by "myProp" , but got none - bad! <WrapperComponent {...props} myProp={1000000} />;} : <ComposedComponentProps extends unknown>(ComposedComponent: React.ComponentClass<ComposedComponentProps, any>) => void
1010
1111 ComposedComponent: React.ComponentClass<ComposedComponentProps>,
1212>ComposedComponent : React.ComponentClass<ComposedComponentProps, any>
@@ -28,15 +28,15 @@ const myHoc = <ComposedComponentProps extends any>(
2828>null as any : any
2929>null : null
3030
31- // Expected no error, got none - good
31+ // Expected no error caused by "myProp" , got none - good
3232 <WrapperComponent {...props} myProp={'1000000'} />;
3333><WrapperComponent {...props} myProp={'1000000'} /> : JSX.Element
3434>WrapperComponent : React.ComponentClass<ComposedComponentProps & { myProp: string; }, any>
3535>props : ComposedComponentProps
3636>myProp : "1000000"
3737>'1000000' : "1000000"
3838
39- // Expected error, but got none - bad!
39+ // Expected error caused by "myProp" , but got none - bad!
4040 <WrapperComponent {...props} myProp={1000000} />;
4141><WrapperComponent {...props} myProp={1000000} /> : JSX.Element
4242>WrapperComponent : React.ComponentClass<ComposedComponentProps & { myProp: string; }, any>
0 commit comments