React event parameter passing?

is written in es6. The this of the function is handled by bind (this) in constructor.

but the question is: what about passing event parameters in
map traversal?

this.func (item) / / this doesn"t work. It"s OK to execute the function
this.func.bind (this,item) / / directly, but it"s not good enough. After all, I"ve already dealt with it in the constructor!
e = > this.func (item) / / current mode

question:
is there a better way to deal with it? Ask for recommendation!

Mar.10,2021

you've already said to use es6, so don't use bind in constructor .
just use () = > {} directly.


e = > this.func (item) / / current mode


I don't quite understand what the event in map traversal means. If we traverse it directly, we can get the parameter directly in the function:


<blockquote>this.func(item) //<br>this.func.bind(this,item) //<br>e=>this.func(item) //</blockquote>
onClick={this.func(item)}

// 
func = (item) => () => {
    // ...
}
Menu