Skip to content

Commit

Permalink
Ignoring 'Setting a timer for a long period of time, i.e. multiple mi…
Browse files Browse the repository at this point in the history
…nutes, 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 facebook/react-native#12981 for more info.

(Saw setTimeout with duration 446716ms)' warning
  • Loading branch information
Guilherme Sanches Flores Queiroz committed Jun 20, 2020
1 parent 19dc2f7 commit 8290036
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions App.js
Expand Up @@ -12,6 +12,16 @@ import useLinking from './navigation/useLinking';
import LinksScreen from './screens/LinksScreen';
import HomeScreen from './screens/HomeScreen';
import Firebase, { FirebaseProvider } from "./config/Firebase";
import { YellowBox } from 'react-native';
import _ from 'lodash';

YellowBox.ignoreWarnings(['Setting a timer']);
const _console = _.clone(console);
console.warn = message => {
if (message.indexOf('Setting a timer') <= -1) {
_console.warn(message);
}
};

const Stack = createStackNavigator();

Expand Down

0 comments on commit 8290036

Please sign in to comment.