I have the following code:
interface BaseProps<TControl> {
onEvent: (control: TControl) => void;
}
class BaseControl<TValue, BaseProps<any>> {
onBlur = () => {
onEvent(this); //subscriber must see the whole TS-class instead of BaseControl<TValue, BaseProps<any>>
}
}
As you can see I can't define class kind of
class BaseControl<TValue, BaseProps<this>>> {}
or infinite
class BaseControl<TValue, BaseProps<BaseControl<TValue, BaseProps<...etc.>>>> {}
Is there any way to implement the similiar generic pointer kinda ? BaseProps<this>