React-native. In child class, super.method is undefined. Why is the parent class method not visible in the super?
export class ParentClass {
constructor(field) {
this.field = field;
}
protected ruleMatch = (type: string): string => {
return type;
}
onGetRule = (type: string) => {
return this.ruleMatch(type);
}
}
export class ChildrenClass extends ParentClass {
// extends method of parent Class
onGetRule = (type: string) => {
if(type === 'typeA') {
return 'anything';
}
return super.onGetRule(type); // TypeError: Cannot read property 'call' of undefined
}
}