1.0.1 • Published 8 years ago

react-deadline v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

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 parse
  • onUpdate function - called every 1000ms (1 second). Use this to set your state to the timer values.

Dependencies