'timer for a long period problem in react native with firebase [duplicate]
I create function to check if the email and password is exists in firebase and its really works but I got a warning every time
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.
I tried to find a solution but I not found.
Solution 1:[1]
Basically you can add this line for disable this warning
componentDidMount() { console.disableYellowBox = true; ... }
or you can use as below
import { YellowBox } from 'react-native';
construct() {
YellowBox.ignoreWarnings(['Setting a timer']);
}
Alyou you should check it same problem with you detail
Solution 2:[2]
To fix this issue...
Navigate to your node_modules/react-native/Libraries/Core/Timers/JSTimers.js file.
Look for the variable MAX_TIMER_DURATION_MS
Change its value to 10000 * 1000
Save the changes (with auto format turned off) and re-build your app.
Found this answer on https://stackoverflow.com/a/58666279/1532987
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | errorau |
Solution 2 | Ali |