@cubetiq/react-use-countdown
React Countdown with trigger
Last updated 5 days ago by sombochea .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @cubetiq/react-use-countdown 
SYNC missed versions from official npm registry.

React Countdown Hook

Installation

# NPM
npm i @cubetiq/react-use-countdown

# Yarn
yarn add @cubetiq/react-use-countdown

Example

import React from 'react';
import ReactDOM from 'react-dom';
// import the countdown hook here
import { useCountdown } from 'cubetiq-react-use-countdown';

const App = () => {
    const { timeleft, start } = useCountdown({
        step: 1000,
    });

    return (
        <div>
            <button onClick={() => start(10000)}>Start Countdown</button>
            <h1>Time left: {timeleft}</h1>
        </div>
    );
};

ReactDOM.render(<App />, document.querySelector('#root'));

Contributors

Project's repository: React Countdown

Current Tags

  • 1.10.7                                ...           latest (5 days ago)

17 Versions

  • 1.10.7                                ...           5 days ago
  • 1.10.6                                ...           10 days ago
  • 1.10.5                                ...           a month ago
  • 1.10.4                                ...           a month ago
  • 1.10.3                                ...           a month ago
  • 1.10.2                                ...           a month ago
  • 1.10.1                                ...           a month ago
  • 1.10.0                                ...           a month ago
  • 1.0.8                                ...           a month ago
  • 1.0.7                                ...           a month ago
  • 1.0.6                                ...           a month ago
  • 1.0.5                                ...           a month ago
  • 1.0.4                                ...           a month ago
  • 1.0.3                                ...           a month ago
  • 1.0.2                                ...           a month ago
  • 1.0.1                                ...           a month ago
  • 1.0.0                                ...           a month ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 20
Last Day 0
Last Week 10
Last Month 146
Dependencies (0)
None
Dev Dependencies (19)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |