When I needed to make a event handler I was doing it like
onClick={() => this.handleClick()}
I have since learned that this is not the best way to do it as the handler gets created each time.
I since learned you can do something like
handleClick = (e) => {
console.log('Event', e);
}
what makes sense to me but it's when you need to pass some other pramaters that I get bit confused
handleClick = (param) => (e) => {
console.log('Event', e);
console.log('Parameter', param);
}
I don't really get the 2 arrows I thought it would be like
handleClick = (param, event) => {
console.log('Event', e);
console.log('Parameter', param);
}
Also what happens if I have more than 1 would it be
handleClick = (param, param2, param3) => (e) => {
console.log('Event', e);
console.log('Parameter', param);
}