L
L
litash2017-07-20 22:04:57
css
litash, 2017-07-20 22:04:57

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

1 answer(s)
A
Alexander Pushkarev, 2017-07-20
@AXP-dev

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 question

Ask a Question

731 491 924 answers to any question