easytimer-react-hook icon indicating copy to clipboard operation
easytimer-react-hook copied to clipboard

Delayed start on component mount

Open boxedcode opened this issue 1 year ago • 0 comments

Hi. First of all, thanks for creating this awesome tool and React hook. I've got a problem that I'm hoping you'll have a solution for.

Using your React hook to implement a countdown, there is a moment when a React component mounts and the countdown displays as 0 hours 0 minutes 0 seconds, before the actual start time appears and starts counting down. It's enough of a delay to be noticeable (feels like 1 - 1.5s).

Has anyone come across this and have a solution? I imagine a solution along the lines of, pseudo-phrasing display the static start time and swap it out with the timer when it starts counting down.

For context, my component hierarchy looks like this:

Page    Timer Container       Countdown < This is where the timer is initialised

Thanks.

boxedcode avatar Jan 22 '24 07:01 boxedcode