Is there a way to access the non-static "foo2" method from inside the static "bar" method? So far, I'm only able to access the "foo1" and "foo3" methods. Can anyone provide guidance on how to achieve this?
let foo1 = () => {
alert('foo1’);
};
class ABC extends Component {
static bar() {
foo1(); //works fine
foo2; //throws error "Can't find variable foo2"
foo2(); //throws error "Can't find variable foo2"
this.foo2(); //throws error "this.foo2 is not a function"
this.foo2; //no error but no alert displayed
ABC.foo3() //works fine
}
foo2 = () => {
alert('foo2');
};
static foo3 = () => {
alert('foo3');
};
}
module.exports = ABC;