Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on I love React Hooks.
>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 }); }
There are no comments on this comment yet.
>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:
Sure it still has the problems of arrow functions I think the arguments against it were worded poorly.