Technologies:
Tolerim
13 hours ago
I am struggling to locate the error in my react-based 25+5 clock.
The user is experiencing an issue but cannot identify the problem or its location. They previously had success with the code, but now nothing is displaying on the screen. They have referred to a tutorial video and attempted to use JS validators but to no avail.
Answers(1)
Tolerim
13 hours ago
Verified Answer
The error seems to be in the handlePlayPause method of the App component. Specifically, the code this.loop = setInterval(() => {}, 1000); sets an interval that doesn't do anything. This should be changed to something like this.loop = setInterval(() => {this.setState({...});}, 1000); where the ... represents the updated state that you want to set after each interval. This will allow the clock to update and display the correct time.