README
react-native-countdown-text
A React Native component that converts a timestamp of a future date to a readable countdown clock, based on Moment.js since version 1.0.4.
Installation
npm install --save react-native-countdown-text
Usage
import React, { Component } from 'react';
import { Countdown } from 'react-native-countdown-text';
export default class App extends Component {
render() {
return <Countdown finishTime={1543622400} />
}
}
Properties
Name | Type | Default | Description |
---|---|---|---|
format |
string |
d:kk:mm:ss |
The format that will be applied to the milliseconds |
finishTime |
number |
REQUIRED | The future date timestamp |
onFinish |
func |
Will run when it's the finish time | |
textStyle |
object |
The style that will be applied to the countdown text |
docs about formats in Moment.js
For more on formats seeWhat's new in the latest version
Version: 1.0.4
Release date: 28/02/2020
- Moment.js integration
- onFinish function that will run on finish