react-clock-counter
This library provides a hook to create a counter with custom datetime and update the clock on provided interval.
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