$ npm install react-native-time-counter --save
or $ yarn add react-native-time-counter --save
import TimeCounter from 'react-native-time-counter';
Name | Description | Type | Default Value |
---|---|---|---|
state | Counter type "forward" or "countdown" | string | forward |
countdownSeconds | Countdown start seconds | number | 120 |
maxSeconds | Counter end seconds | number | null |
onCountdownEnd | Todo when countdown end | function | null |
onMaxSeconds | Todo when counter equal to max seconds | null | |
hideHour | To hide hour text | boolean | true |
style | Container style | object | |
fontStyle | Text style | object |
<TimeCounter state={"forward"}
hideHour={false}
onMaxSeconds={() => console.log('Test')}
maxSeconds={10}/>
<TimeCounter state={"countdown"}
hideHour={false}
onCountdownEnd={()=>console.log('Test')}
countdownSeconds={10}/>