Replies: 3 comments 3 replies
-
Hey, you can start by reading the props the component exposes. |
Beta Was this translation helpful? Give feedback.
1 reply
-
function ProgressBar(props) {
return (
<div className='ProgressBar'>
<CountdownCircleTimer
isPlaying
duration={5}
colors={[['#00f815', 0.5], ['#FFFF00', 0.5], ['#FF0000']]}
/>
{({ remainingTime }) => {
/// your code here
if(remainingTime == 0)
props.myFunction();
return null
}}
</CountdownCircleTimer>
</div>
);
}
export default ProgressBar; |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for your fast reply; i have this warning, do you have a solution? index.js:1 Warning: Cannot update a component ( Code in component Competition {displayProgress &&<ProgressBar close={()=>setDisplayProgress(false)}/>} Code in ProgressBar component function ProgressBar(props) {
return (
<div className='ProgressBar'>
<CountdownCircleTimer
isPlaying
duration={5}
colors={[['#00f815', 0.5], ['#FFFF00', 0.5], ['#FF0000']]}
size={140}
strokeWidth={12}
trailColor='#00000000'>
{({ remainingTime }) => {
if (remainingTime === 0) {
props.close();
return null;
}
return (
<div className='value'>
{Math.floor(remainingTime / 60): {remainingTime % 60}s`}
</div>
);
}}
</CountdownCircleTimer>
</div>
);
}
export default ProgressBar; |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hy Vydimitrov,
How can i use props with your counter ? I want do an action on App when the timer is over.
Beta Was this translation helpful? Give feedback.
All reactions