talalmajali / react-native-countdown-component

React Native CountDown
MIT License
266 stars 233 forks source link

Is there a way to shown the countdown time, but start the countdown on demand? #65

Closed augustosamame closed 4 years ago

augustosamame commented 4 years ago

I would like to show the timer with maximum time, for example 00:60, until the user presses a Start button. At this point, the countdown will start. However, passing until prop will always start the countdown, and I can't get it to show the max time without passing it until prop. Thanks in advance for any tips.

augustosamame commented 4 years ago

For anyone looking for this, it was really simple. Countdown has a boolean prop called running.

running={false}

shows the stopped timer. so if you implement something like:

running={this.state.running}

you can toggle the countdown on and off.