0
REACT Code Error
I want to Make a timer . on start button timer started and incrementing the value works correctly. But I want to pause the timer I make a function but It gives me error on line no 16 https://www.sololearn.com/post/334673/?ref=app https://www.sololearn.com/post/334674/?ref=app
5 Answers
+ 6
Hard for me to go on without knowing the error, tho my guess is that the onstop function is not binded to the class (the onstart function is an arrow function so it automatically gets binded)
Also, if you can re-create the code on sololearn it will be much easier if i can play around with it.
You can use this template:
https://code.sololearn.com/Wi772Mr81mX8/?ref=app
+ 4
Oy
I totally missed that CalviŐ˛ đ
+ 2
clearInterval(this.clearInterval)
0
Burey thanks it's working
I forget to bind the stop function
I already added clearInterval method in componentwillmount but after I add CleartimeOut in stop method my code working to expectations