79197807

Date: 2024-11-17 17:57:23
Score: 1.5
Natty:
Report link

One thing you should have in mind is that the value of count inside the closure does not automatically update on each render, but from the first execution the closure will always see the value of count. Therefore setCount(1) will always be repeatedly called because count + 1 will result to 1, which means counter will no longer increment

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Jeremih Adebayo Akingbade