Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript React Components Stateful Components and Lifecycle Methods Resetting the Stopwatch

Nancy Melucci
seal-mask
.a{fill-rule:evenodd;}techdegree
Nancy Melucci
Front End Web Development Techdegree Student 34,198 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 ?

Brandon White
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brandon White
Treehouse Moderator

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
seal-mask
.a{fill-rule:evenodd;}techdegree
Nancy Melucci
Front End Web Development Techdegree Student 34,198 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
seal-mask
.a{fill-rule:evenodd;}techdegree
Nancy Melucci
Front End Web Development Techdegree Student 34,198 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