1.0.2 • Published 6 years ago

react-native-countdown2 v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

react-native-countdown2

Rreact Native 倒计时组件

Getting started

1.安装

npm
$ npm i react-native-countdown2 --save
yarn
$ yarn add react-native-countdown2

2.导入

import CountDown from 'react-native-countdown2';

Properties

PropDefaultTypeDescription
  time               null      Number     倒计时结束时间戳        
  endTitle            已结束      String     倒计时结束后显示的文字    
  endFunc       null    Function   倒计时结束回调
renderCountDown  null            Function        自定义倒计时,接收一个参数可以获取倒计时

Example

<CountDown
   endFunc={() => console.log(item.name)}
   style={styles.countDown}
   endTitle="结束一波"
   renderCountDown="(date) => <Text>{date.days}:{date.hours}:{date.minutes}:{date.seconds}</Text>"
   time={this.state.time}/>