I
I
Insolation2018-04-12 22:58:58
JavaScript
Insolation, 2018-04-12 22:58:58

How to change disable to enable for a button correctly?

Hey guys. Something I can't get through. I have buttons, by pressing which I send a request to the server. And when you click on one of the buttons, this button should take the state disable, while the others remain enabled. When you click on another button, disable is removed from the previous one and switches to the current one .
By default, all buttons should be enable
Now everything becomes right for me disable, because I have one property for all buttons. Please tell me how to fix it?
Code - https://codesandbox.io/s/n3opyz4m2p

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-04-12
@Insolation

Describe the buttons as an array, and instead of isDisabled store the index of the inactive button, something like this .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question