How to use the react-countdown.useCountdown function in react-countdown

To help you get started, we’ve selected a few react-countdown examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ndresx / react-countdown / examples / src / CountdownHook.tsx View on Github external
const CountdownHook: React.FC = () => {
  const props = useRef({ date: Date.now() + 5000 });
  const { hours, minutes, seconds, api } = useCountdown(props.current);
  return <span>{api.isCompleted() ? 'Completionist!' : `${hours}:${minutes}:${seconds}`}</span>;
};

react-countdown

A customizable countdown component for React.

MIT
Latest version published 4 months ago

Package Health Score

72 / 100
Full package analysis

Popular react-countdown functions