How do you hide the warnings in React Native iOS simulator?

Some Guy picture Some Guy · Feb 10, 2016 · Viewed 79.4k times · Source

I just upgraded my React Native and now the iOS simulator has a bunch of warnings. Besides fixing them, how do I hide these warnings so that I can see what's underneath?

Answer

Moussawi7 picture Moussawi7 · May 10, 2016

According to React Native Documentation, you can hide warning messages by setting disableYellowBox to true like this:

console.disableYellowBox = true;

Update

~~console.disableYellowBox~~ is removed and now you can use:

import { LogBox } from 'react-native';
LogBox.ignoreLogs(['Warning: ...']); // Ignore log notification by message
LogBox.ignoreAllLogs();//Ignore all log notifications

to ignore all log notifications