facebookexperimental/Recoil

[React Native] "Setting a timer for a long period of time" warning

Open

#1,030 opened on May 16, 2021

View on GitHub
 (8 comments) (32 reactions) (0 assignees)JavaScript (1,151 forks)batch import
help wantednative

Repository metrics

Stars
 (19,428 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Version 0.3.0 produces warning:

 WARN  Setting a timer for a long period of time, i.e. multiple minutes, is a performance and correctness issue on Android as it keeps the timer module awake, and timers can only be called when the app is in the foreground. See https://github.com/facebook/react-native/issues/12981 for more info.

Happens because of https://github.com/facebookexperimental/Recoil/blob/master/src/hooks/Recoil_Hooks.js#L60.

Any plans to fix it?

Contributor guide