Closed sampattuzzi closed 4 months ago
The proper solution here, fwiw, is in the constructor, to do this.handleClick = this.handleClick.bind(this)
- or, to do handleClick = this.handleClick.bind(this);
as a class field right above the method.
Also, we already have the jsx-no-bind
rule.
This rule already exists in typescript-eslint but isn't detected in the context of JSX.
The rule should warn about this usage and possible duplicated the functionality of the rule in typescript-eslint: https://typescript-eslint.io/rules/unbound-method