react-native-countdown-text
v1.0.5
Published
Tiny React Native component that formats a timestamp (of a date in the future) to a readable countdown to that time
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-textUsage
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|
For more on formats see docs about formats in Moment.js
What'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
