Languages

React - how to conditionally disable button?

3 points
Asked by:
Wayne
475

Can you tell me how to conditionally disable Start/Stop buttons when the counter is already counting?

I wanted to prevent another counter from being set by double-clicking the Start button.

My code:

1 answer
3 points
Answered by:
Huzaifa-Ball
475

I found a solution and made an article - React - setInterval example.

Quick solution:

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join