How to detect the TH that I clicked and go through parameter in React?
I wanted to do an ordering, but I'm having difficulty going through a parameter in a function that I clicked on, can anyone help me with this?
ordertableBy = async(ev) => {
console.log(ev.target.value);
alert('orderby' + ev.target.value);
}
<tr>
<th onClick={ev => this.ordertableBy(ev)}>Nome</th>
<th onClick={ev => this.ordertableBy(ev)}>Email</th>
<th onClick={ev => this.ordertableBy(ev)}>Telefone</th>
</tr>
Returning orderby undefined