I\'ve read a bunch of articles about the use of () => {}
syntax, binding in the constructor, binding in the props etc.. but from what I understand, binding
For your {item.name}
this typically means you need another layer of abstraction IE a new react component that returns the same element but you can pass in the onClick as a prop as well as item id as a prop. Then in that component you would call this.props.onClick(this.props.id)
or however you format the data.
this article draws out all the differences between each way of binding instance methods as well as how each impacts performance https://medium.com/@housecor/react-binding-patterns-5-approaches-for-handling-this-92c651b5af56#.