TypeScript Version: 3.4.1
Search Terms:
Code
interfaceComponent<P>{(props: P): unknown;// Comment this out and it worksdefaultProps?: Partial<P>;}declarefunctionmyHoc<Props>(C: Component<Props>): Component<Props>;typeProps<T>={t: T;foo: number};declarefunctionMyComponent<T>(props: Props<T>): unknown;// Expected type: <T>(props: Props<T>) => unknown// Actual type: Component<Props<{}>>constMyComponent2=myHoc(MyComponent);// Workaround: assert the resulting typeconstMyComponent3=myHoc(MyComponent)astypeofMyComponent;
TypeScript Version: 3.4.1
Search Terms:
Code