1.0.1 • Published 8 years ago
react-deadline v1.0.1
React Deadline
Countdown Timer for React and React Native
Install
npm install react-deadline --save
import CountdownTimer from 'react-deadline';
...
render() {
return (
<CountdownTimer
endsAt={this.props.date}
onUpdate={timer => this.setState({timer: timer})>
{`${this.state.timer.hours}:${this.state.timer.minutes}:${this.state.timer.seconds}`}
</CountdownTimer>
)
}
Properties
endsAt
string - any string that moment js can parseonUpdate
function - called every 1000ms (1 second). Use this to set your state to the timer values.