DEV Community

Discussion on: How to develop a Stopwatch in React JS with custom hook

Collapse
 
keomalima profile image
Keoma Lima

Hello! I've adapted your code on my react native application but as soon as my screen is blocked, the timer stops running, do you have any idea on how I can keep the timer running even with the screen blocked? Thanks a lot

Collapse
 
abdulbasit313 profile image
Abdul Basit

Though I haven't implemented it, but there are some events in react native that can be called on blocking the screen or going back, so on that event, you can save the timer in async storage. There can be multiple ways to achieve it...