react-timer-hook
Advanced tools
Comparing version
@@ -36,3 +36,3 @@ import { useState, useEffect, useRef } from 'react'; | ||
setHours(prevHours => { | ||
if (prevHours === 24) { | ||
if (prevHours === 23) { | ||
addDay(); | ||
@@ -75,3 +75,3 @@ return 0; | ||
function clearTimer() { | ||
function resetTimer() { | ||
if (intervalRef.current) { | ||
@@ -109,3 +109,3 @@ clearInterval(intervalRef.current); | ||
return { seconds, minutes, hours, days, startTimer, stopTimer, clearTimer }; | ||
return { seconds, minutes, hours, days, startTimer, stopTimer, resetTimer }; | ||
} |
{ | ||
"name": "react-timer-hook", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "React timer hook is a custom react hook built to handle timers and count down logic in your react component.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -24,4 +24,2 @@ ## react-timer-hook | ||
export default function App() { | ||
const now = new Date() | ||
const after10Days = now.setDate(now.getDate() + 10); | ||
const { | ||
@@ -28,0 +26,0 @@ seconds, |
216235
-0.04%71
-2.74%