Languages

React - handleClick switch error

0 points
Asked by:
Gigadude
791

Do you know why my handleClick function throws an uncaught error?

my code:

stacktrace:

1 answer
0 points
Answered by:
Mikolaj
519

I found the solution to the problem.

I didn't include break in any of the cases, so all the cases below were executed, including throwing an error.

Here's the 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