Typescript: "Potentially invalid reference to 'this' of a class from closure" in constructor?
I get the above error from the "this.addField" command in the constructor. Is that error right? I thought I don't have to bind member methods called in the ctor?
class Foo extends Item {
constructor(someDrilledProp: string) {
super();
this.name = this.addField(someDrilledProp);
}
}
Please sign in to leave a comment.
Can't reproduce with similar code
Could you share a complete, self-containing code snippet the issue can be repeated with?
maybe this?
No such errors are reported for me
Can you reproduce the issue in a new project?