I have 3 children divs
wrapped in one parent div
as shown :
On click of each child div
, I want its background-color to be changed to red. but if there is already one div
with background-color red and some other div
is clicked then its background color should be changed to white. There will be only one div
with background color red. I am newbie to react. I read about classNames and states
in React but can't find out how can I do this.
Thanks in Advance.