I'm trying to create a base class from React.Component and two classes from the base class like this:
interface BaseItemProps {
base_prop: string;
}
class BaseItem<P, T> extends React.Component<BaseItemProps, any> {
}
class ItemClass1 extends BaseItem<BaseItemProps, any> {
}
interface ItemProps extends BaseItemProps {
item_prop: string;
}
class ItemClass2 extends BaseItem<ItemProps, any> {
}
The problem is that class ItemClass2 doesn't see this.props as ItemProps but as BaseItemProps (this.props.item_prop is not available). What am I doing wrong?