vydimitrov / react-countdown-circle-timer

Lightweight React/React Native countdown timer component with color and progress animation based on SVG
MIT License
692 stars 87 forks source link

Cannot render externally updated timer #199

Closed johnnyrainbow closed 2 years ago

johnnyrainbow commented 2 years ago

I have a time that I am passing into CountDownCircleTimer that is independently updated & retrieved via an external API call, and I cannot figure out a way to render this externally managed time with this timer, as the CountdownCircleTimer component seems to want to perform its own timing logic on the passed time, which messes up the functionality.

Is there a way to just straight up render a number as the time without it trying to perform timing logic on it?

Thanks!

vydimitrov commented 2 years ago

Hey @johnnyrainbow, you will need to set isPlaying={false} and then just pass your remaining time to the initialRemainingTime prop, you may also need to pass the same remaining time as a key prop to the component in case it does not rerender the new time you provide.

vydimitrov commented 2 years ago

Closing this issue, let me know in case you have any other questions.