FCC: 25 + 5 Clock freeCodeCamp

I’m building 25 + 5 Clock project. I got stuck with the timer. The timer is working immediately when you open the project page. I used useEffect to make the timer runs.
The timer must run only when I click the button. But how to do that?

Just don’t call the method immediately. Use this instead

onClick={() => props.function()}

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.