I have a base class which extends React.Component and is extended by several child classes. Now I want to have the type of the Parent class as the type of a property, and all Child classes should be valid for the property. I had a try of this answer, but it doesn't work when Parent extends React.Component.
class Parent extends React.Component{}
class Child1 extends Parent {}
class Child2 extends Parent {}
type F = {
cp: { new(): Parent }
}
let f: F = {
cp: Child1 //type 'typeof Child' is not assignable to type 'new () => Parent'.
}