0

How can i get the which a element is clicked i cant take can you help me ? I am working with react 0.14

CODE :

const role = ['admin', 'user', 'x', 'y']

menuClick = (e) => {
  e.preventDefault();
}

<ul>
  {role.map((item)=> <li > <a  onClick={this.menuClick} > {item}</a> </li> )}  
</ul>
adiga
  • 34,372
  • 9
  • 61
  • 83
Oğuzhan
  • 73
  • 1
  • 8
  • You can edit your question. Don't post a comment! – Akif Feb 26 '21 at 12:18