question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:32
  • Comments:8

github_iconTop GitHub Comments

8reactions
enzomanuelmanganocommented, Sep 5, 2021

I got this error when using Recoil in React Native (0.64). Is there a fix planned? I believe it’s caused from the SUSPENSE_TIMEOUT_MS in the Recoil_Hooks file. Is it safe to ignore the warning?

5reactions
samridhguptacommented, Jul 29, 2021

Seems like the performance on android is bit laggy too

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting a timer for a long period of time, i.e. multiple minutes
Navigate to your node_modules/react-native/Libraries/Core/Timers/JSTimers.js file. · Look for the variable: MAX_TIMER_DURATION_MS · Change its ...
Read more >
Warning about "setting a timer for a long period of time" when ...
The short answer is: the way ably-js uses timers understands this and is appropriate for how they work in react-native on Android, and...
Read more >
Timers - React Native
Timers are an important part of an application and React Native implements the browser timers. Timers​. setTimeout, clearTimeout; setInterval, ...
Read more >
React Native Warning: “Setting a timer for a long period of time ...
This is a warning that certain javascript dependencies will raise on react-native due to an issue on their side and must be solved...
Read more >
react native setting a timer for a long period - Code Grepper
react native Setting a timer for a long period of time ; 1. in node_modules > react-native > Libraries > Core > Timers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found