react-countdown-clock icon indicating copy to clipboard operation
react-countdown-clock copied to clipboard

canvas re-render on state change

Open mihaid85 opened this issue 7 years ago • 1 comments

Hi,

Changing the seconds prop with setState causes the component to re-render over existing drawing. As soon as the timer ticks, the render looks as it should, so it's not a big problem unless the timer is paused. Then it ends up looking like in the attached screenshots.

Thanks.

Before changing seconds props: screen shot 2018-05-08 at 15 33 45

After changing state: screen shot 2018-05-08 at 15 33 57

This is the component: <ReactCountdownClock seconds={this.state.sessionMinutes*60} color="#000" alpha={0.9} size={300} paused={this.state.pause} />

and this is the parent state: this.state={ sessionMinutes: 8, pause: true };

mihaid85 avatar May 08 '18 12:05 mihaid85

Hello,

same here, any workaround regarding this?

epozsh avatar Aug 21 '19 07:08 epozsh