Closed GoodForOneFare closed 7 years ago
@lemonmade would this rule be useful? Can we just enforce @autobind
everywhere?
I think it's not universally applicable. It is never needed for React lifecycle hooks (most notably, render), and not needed if a function actually doesn't use this
(unlikely and undesirable, but occasionally needed), and not needed for methods that are never passed as callbacks. IMO, too many potential issues to make it a rule.
Like no-unbound-method on steroids:
requestAnimationFrame(this.bar)
@autobind
This is fine:
This is fine:
This is bad: