Answer the question
In order to leave comments, you need to log in
Make selection on click on only one ReactJS element?
It is necessary to make it so that when you click on the second block, the background-color and checked from the input are removed from the first block, and the second block appears and vice versa, in general, there should be only one active element. How to do it? I don't understand how, please help. An example is below.
https://codepen.io/litash/pen/dRxJGv
Answer the question
In order to leave comments, you need to log in
Add a name attribute to input
<input type="radio" name="item" checked={ checked } id="radio" />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question