Help wth Pomodoro react app

Hello everyone,

I used React to build the Pomodoro clock. I can’t figure out what’s wrong, but running the tests gives different results depending on the number I use for the setInterval. It actually passes all tests if the interval is set to 10, or 20. Fails user story 21 (If the timer is paused and I click the element with id="start_stop" , the countdown should resume running from the point at which it was paused.) when the interval is at 30 or 40. Fails User Story #25 (When a break countdown reaches zero (NOTE: timer MUST reach 00:00), a new session countdown should begin, counting down from the value currently displayed in the id="session-length" element.) when interval is at 50. And fails several tests if interval is set at 1000 (1 second) because the timer, the test claims does not reach 00:00 even though it does when I see it working. Perhaps my entire approach is wrong. Any help would be appreciated.

Link to my CodePen:

Figured it out. I put setInterval in componentDidMount and clearInterval in componentWillMount. I needed to add setInterval to the start/stop button and clearInterval to the reset button as well.

Update for anyone having similar issues. I needed to completely remove componentDidMount and componentWillUnmount altogether, since the clock was working erratically when I had setInterval and clearInterval within them, even though it was passing the tests. I also realized that even though the clock was passing all tests, it was not working correctly (when the clock reached zero, it always reset to the session length). I fixed that, and now I believe everything is working correctly. I hope this helps anyone who might be experiencing similar problems.