A
A
Artem2020-06-15 19:34:30
React
Artem, 2020-06-15 19:34:30

ESLint plugin reminiscent of .bind in react callbacks?

Good afternoon! Is there an ESLint plugin that will remind you to use an arrow function or .bind in a React callback?

I found only react/jsx-no-bind , which forbids passing .bind or arrow function directly in arguments

But nothing about cases when a class component method is passed

class Component {
  foo() {
    this.setState(...)
  }

  render() {
    return <App callback={this.foo} />
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question