I have a react app with react-countdown-circle-timer installed.
When the onComplete() method of the circle timer fires, I am setting the state but I get this warning:
Warning: Cannot update during an existing state transition (such as within 'render').
import React from 'react';
import { CountdownCircleTimer } from 'react-countdown-circle-timer';
export default class Test extends React.Component {
constructor() {
super();
this.state = {
userMustWait: false
}
}
render() {
return (
<CountdownCircleTimer
isPlaying
durationSeconds={3}
colors={[["#004777", 0.33], ["#F7B801", 0.33], ["#A30000"]]}
onComplete={() => { this.setState({ userMustWait: false }) }}
/>)
}
}