1.0.0 • Published 3 years ago
react-native-time-counter v1.0.0
react-native-time-counter
Install
$ npm install react-native-time-counter --save
or $ yarn add react-native-time-counter --save
Import
import TimeCounter from 'react-native-time-counter';
Props
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 |
Forward Usage
<TimeCounter state={"forward"}
hideHour={false}
onMaxSeconds={() => console.log('Test')}
maxSeconds={10}/>
Countdown Usage
<TimeCounter state={"countdown"}
hideHour={false}
onCountdownEnd={()=>console.log('Test')}
countdownSeconds={10}/>
1.0.0
3 years ago