uncheck checkbox programmatically in reactjs uncheck checkbox programmatically in reactjs reactjs reactjs

uncheck checkbox programmatically in reactjs


There is property of checkbox checked you can use that to toggle the status of check box.

Possible Ways:

1- You can use ref with check boxes, and onClick of button, by using ref you can unCheck the box.

2- You can use controlled element, means store the status of check box inside a state variable and update that when button clicked.

Check this example by using ref, assign a unique ref to each check box then pass the index of that item inside onClick function, use that index to toggle specific checkBox: