React timer hook is a custom react hook built to handle timers(countdown), stopwatch and time logic/state in your react component.
Package Exports
react-timer-hook
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-timer-hook) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-timer-hook
React timer hook is a custom react hook, built to handle timer, stopwatch, and time logic/state in your react component.
useTimer: Timers (countdown timer)
useStopwatch: Stopwatch (count up timer)
useTime: Time (return current time)
Setup
yarn add react-timer-hook OR npm install --save react-timer-hook
if set to 12-hour time will be formatted with am/pm
Values
key
Type
Description
seconds
number
seconds value
minutes
number
minutes value
hours
number
hours value
ampm
string
am/pm value if 12-hour format is used
Deprecation Warning:
Starting from v1.1.0 and above default export useTimer is deprecated, your old code will still work but it is better to start using named exports { useTimer, useStopwatch, useTime }