is a customized component for counting down
npm install timer-react-hookis a customized component for counting down
TimeToJump: example of how to use timeToJump``javascript
import React from 'react';
import './App.css';
import useTime, { countUp } from 'timer-react-hook';
function TimeToJump({ expiryTimestamp }) {
const {
seconds,
minutes,
hours,
days
} = useTime({ expiryTimestamp });
return (
}>
{}
{${countUp({days, hours, minutes, seconds}) ? 'PAST' : ''}}
function App() {
let t = new Date();
let oneHour = 60*60;
let twoDay = oneHour 24 2;
t.setSeconds(t.getSeconds() + 10 );
return (
export default App;
``
| key | Type | Required | Description |
| --- | --- | --- | ---- |
| expiryTimestamp | number(timestamp) | YES | it will count down from expiryTimestamp until to 0 then count up with color changes