Hacker News new | ask | show | jobs
by tekkk 2719 days ago
So can someone explain what the author means by the problem of #3:

>However, there are times when we need to pass an extra parameter. In those cases, we cannot use bind because we cannot use bind with arrow functions.

But you can pass the extra argument to the arrow function directly: `onChange={handleChange('name')}`. And use it as:

  handleChange = (field) => (e) => {
    this.setState({ [field]: e.target.value });
  }
Sure it still has the problems of arrow functions I think the arguments against it were worded poorly.