Open
Description
Hi, I was creating a simple timer screen for an app and was using the library to update the timer every minute as so:
const [timer,setTimer]=useState(moment(new Date()).format('hh:mm:ss A (DD/MM/YYYY)');
BackgroundTimer.runBackgroundTimer(() => {
//code that will be called every 3 seconds
setTimer(moment(new Date()).format('hh:mm:ss A (DD/MM/YYYY)');
},
60000);
And have a button element, which when pressed should stop the timer, like so:
<Button onPress={()=>{BackgroundTimer.stopBackgroundTimer(); }}>Stop</Button>
However despite pressing the button, the timer does not stop and continues to update the app.
Metadata
Metadata
Assignees
Labels
No labels