I'm trying to do a hoc for a state component in React Native with Typescript which is defined below:
export function hoc<T extends ComponentClass>(target: any): T {
return (target: any) =>
class MyClass extends Component<any, any> {
}
}
But I get the error Type '(target: any) => typeof MyClass' is not assignable to type 'T'
What should I change to make it correct with typescript?