ideas icon indicating copy to clipboard operation
ideas copied to clipboard

useCountdown

Open jackkav opened this issue 7 years ago • 0 comments

A hook to display a countdown from a given time in the future.

function MyComponent() {
  const {days, hours, minutes, seconds} = useCountdown(() => Date.now() + 99999999);
  return (
      <div>{`${days}:${hours}:${minutes}:${seconds}`}</div>
  );
}

https://github.com/bsonntag/react-use-countdown perhaps use requestAnimationFrame

jackkav avatar Oct 28 '18 23:10 jackkav