[Statistic.Countdown] Would be nice to have a pause/start api. #26182
Labels
help wanted
The suggestion or request has been accepted, we need you to help us by sending a pull request.
Inactive
What problem does this feature solve?
In some cases, countdown might need to be paused and continue later on.
What does the proposed API look like?
const { Countdown } = Statistic;
const deadline = 1000 * 30; // mili seconds, not depend on Data.now()
const ref= useRef(null);
const autoStart = false; // boolean
// once mounted, we can call following API to control the countdown
ref.start()
ref.pause()
Countdown: ref={ref} autoStart={autoStart} value={deadline} onFinish={onFinish}
The text was updated successfully, but these errors were encountered: