Skip to content

Delayed start on component mount #2

@boxedcode

Description

@boxedcode

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions