Unable to update Boolean state in react
0
I've a Boolean state clicked
that is used to show the value of a switch.
Whenever the user presses the switch the opposite of current state should become the new state. I tried like below
But it is not working as expected. How can I make it work like i expected?