react-clock-counter
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

react-clock-counter

This library provides a hook to create a counter with custom datetime and update the clock on provided interval.

NPM JavaScript Style Guide

Install

npm install --save react-clock-counter

Usage with provided component.

import React, { Component } from 'react'

import { ClockCounter } from 'react-clock-counter'

class Example extends Component {
  render() {
    return <ClockCounter />
  }
}

Usage with hook

import React from 'react';
import { useClockCounter } from 'react-clock-counter'
function Example() {
    const {time} = useClockCounter();
    return <div>{time.toString()}</div>
}

License

MIT © krishnapaul242

Readme

Keywords

none

Package Sidebar

Install

npm i react-clock-counter

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

19.2 kB

Total Files

11

Last publish

Collaborators

  • krishna.paul