react-deadline

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i react-deadline

Weekly Downloads

3

Version

1.0.1

License

ISC

Last publish

Collaborators

  • zackperdue