Closed
Description
I ran the following simple js program. But I got an error at line this.getA(); which is totally unrelated here. The error said "stateless functional components should not use this (react/no-this-in-sfc)"
class Demo {
getA = () => 'a';
hasBug = () => {
this.getA();
return null;
};
}
What did you expect to happen?
No error expected
What actually happened? Please include the actual, raw output from ESLint.
Got this error - stateless functional components should not use this (react/no-this-in-sfc) for line this.getA()