yassinedoghri / react-timer-machine

React Timer Machine is a fully controllable and customizable timer component for react
https://react-timer-machine.yassinedoghri.com
MIT License
12 stars 2 forks source link

Timer pauses in background #7

Open dblock opened 6 years ago

dblock commented 6 years ago

Looks like my timer is pausing in background in a react-native app, which seems to be normal since Expo doesn't support background tasks.

You can work around it by keeping start and end time, maybe the timer itself can support this kind of behavior and by doing the diff rather than counting seconds?

yassinedoghri commented 6 years ago

I was planning on changing the timer to work using diff but wasn't aware of that bug as I haven't tested it in a react-native app. Thanks for the heads up!