ndresx / react-countdown

A customizable countdown component for React.
MIT License
748 stars 69 forks source link

overtime true is not going to negative #158

Closed mtahirofficial closed 2 years ago

mtahirofficial commented 2 years ago

We tried to implement overtime true but it stops at 0:0:0 and not goes to negative time. Please help us to make it possible, we may be doing something wrong

`const renderer = ({ hours, minutes, seconds, completed }) => { return ( {hours}:{minutes}:{seconds} ); };

ReactDOM.render( <Countdown date={Date.now() + 5000} renderer={renderer} overtime={false}/>, document.getElementById("root") );`

ndresx commented 2 years ago

Hi, since you are providing a custom renderer, you would have to render this yourself, as you can see here https://github.com/ndresx/react-countdown/blob/master/src/Countdown.tsx#L343. You can check for ´total < 0`, which signalizes that the countdown went into overtime. I hope this helps?