Answer the question
In order to leave comments, you need to log in
How to correctly type a method of a child class in the parent?
There is a class A
that extends the class B
. The class A
has a method test
. When calling a method test
in a class, B
we get a warning:
TS2339: Property 'test' does not exist on type 'B'.
class A extends B {
test(): void {}
}
class B {
handle(): void {
this.test();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question