Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart Timer on Button Press without changing Untill #85

Open
usmanarif12 opened this issue Jul 16, 2020 · 5 comments
Open

Restart Timer on Button Press without changing Untill #85

usmanarif12 opened this issue Jul 16, 2020 · 5 comments

Comments

@usmanarif12
Copy link

usmanarif12 commented Jul 16, 2020

Hello , could you guide me please on how to restart my timer on a button press with the same previous Untill value? i need it please help me

@RaildoBarros
Copy link

i need this too

@Motazlubbad
Copy link

me too

@VSV6
Copy link

VSV6 commented Mar 31, 2021

Same here!!

@tekalpavan
Copy link

Any update on this yet?

@tekalpavan
Copy link

tekalpavan commented Apr 20, 2021

You can do this by having a state variable to show and hide the component. This is a work around right now.

const [isCounterVisible, setIsCounterVisible] = useState(true);

const afterCountdownMethod = () => {
// do something here
setIsCounterVisible(false)
}

const someOtherMethodWhichEnablesCounter = () => {
setIsCounterVisible(true)
}

render (
                <CountDown
                    until={180}
                    onFinish={() => afterCountdownMethod}
                    size={20}
                    timeLabels={{ m: null, s: null }}
                    showSeparator={true}
                  />
)

This is restart the counter whenever it is mounted to the DOM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants