Removing Warnings from React Native

in react •  7 years ago  (edited)

There’s something that annoys me a little sometimes with React Native— the warning messages. Sometimes they can be useful if I have forgotten to give keys to list items or if I’ve supplied an incorrect type as a prop for a component. But sometimes they aren’t very useful at all…I’m mainly talking about situations like remote debugging. If you have remote debugging on and Chrome is in the background you get a yellow box warning:

This is the default behavior, and if you’re constantly switching windows or have multiple screens like me it’s frustrating. Thankfully it is really easy to get rid of. Just use the following code at the entry points for your app(index.android.js/index.ios.js):


console.ignoredYellowBox = ['Remote debugger is in a background'];


You can use it for other warnings that aren’t important to you too, just keep adding to the array with new strings for the specific warning you want ignored. Happy coding!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @jordanmohi! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You published your First Post
You got a First Vote

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @jordanmohi! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!