Home > OS >  how to get button value to another react component?
how to get button value to another react component?

Time:02-04

so i have a form component having button array, though i used icons in it with value attribute. just like below.

<button value={'admin'} onClick={(e)=> handleClick(e.target.value)}>
      <FaUserSecret classname="text-lg" />
</button>

in handleClick function e.target.value is returning icon instead of admin.

Thanks in advance

  • Related