React - Quick implementation

Used React, useEffect etc.


Requested feedback

Its a bit weird in my implementation that useEffect, which should be for side effects, is actually doing the 'main' thing of my code, i.e. counting down. This causes some weird behaviour (e.g. timer 'stops' at 1s) how could I do this better?

Comments

You must be signed in to post a comment

Get future questions delivered straight to your inbox for free

Sign up and receive instant access to new questions when we publish them.

We‘ll only use your information to deliver new questions and to provide you updates about our product. We‘ll never spam you or sell your information without your consent. Unsubscribe at any time.