mardi 18 février 2020

How to create different Id for the same label inside a React Component for any Input field

My requirement is to create a new Row which will be containing a checkbox field, thus let's say I will create three such rows which have these Checkbox fields. The problem arises when I am trying to create a ID for the checkbox field, as my label remains same, thus same ID is getting generated for all the three checkbox fields which are present over three different rows, Thus when I am trying to hover over the second or third row checkbox, the first one gets Focus and also gets checked when I clicking on the label.

Please Let me know if someone has tackled this kind of issue. Please provide some pointers to any document which provides solution for such scenarios.




Aucun commentaire:

Enregistrer un commentaire