pughpugh / react-countdown-clock

HTML5 canvas countdown clock React component
ISC License
187 stars 83 forks source link

Timer is not updated with new props (seconds) #45

Closed zchauhan closed 6 years ago

zchauhan commented 6 years ago

I guess issue is with componentDidUpdate method, if seconds is different in previous and new props then it is selecting previous props not the new one.


    if props.seconds != @props.seconds
      @_seconds = props.seconds
      @_setupTimer()```
pughpugh commented 6 years ago

Agreed, that looks suspect. Thanks, I will take a look.

zaidchauhan commented 6 years ago

@pughpugh PR for the same - https://github.com/pughpugh/react-countdown-clock/pull/46

pughpugh commented 6 years ago

Fixed in 2.1.0.