Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Components (2018) Stateful Components and Lifecycle Methods Resetting the Stopwatch

Nancy Melucci
PLUS
Nancy Melucci
Courses Plus Student 36,143 Points

handleReset breaks the program

I've been following this and I've actually finished this stage. But I had to remove handleReset because the whole thing crashes. I studied it carefully AND I removed my code and put in the instructor's from the final version.

I've tried replacing the handleReset function with some vanilla JS version but I am neither good nor clever enough to make that work.

Again, this is clearly a problem with the code supplied. I've replaced all the parts that were worked on in this stage. The compiler just isn't having it.

I would like to finish this course. I am hoping someone knows what might be going on. Happy holidays everyone. I love Treehouse.

Hi Nancy Melucci,

I tried running code by downloading it and it's working fine. Is there is any error in console at the time of crash ?

I know you’re saying that the code is what’s supplied but the instructor, but would you mind pushing it to a repo anyway and posting a link to it here?

2 Answers

Nancy Melucci
PLUS
Nancy Melucci
Courses Plus Student 36,143 Points

Well...a Christmas miracle. I re-inserted the code from the instructor file, and now my stopwatch runs and doesn't break the program.

I am deeply confused but I am not going to ask any more questions.

Happy holidays and thanks for responding. I wish you a happy and prosperous new year. Stay well.

Nancy Melucci
PLUS
Nancy Melucci
Courses Plus Student 36,143 Points

Within the next 48 hours I'll put it in my Github. The error message is very long. I'll see what I can do about reproducing that.

Happy holidays everyone. Thanks for responding. NJM