Removing Warnings from React Native

in #react7 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!

Sort:  

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!

Coin Marketplace

STEEM 0.27
TRX 0.21
JST 0.038
BTC 96824.35
ETH 3678.06
USDT 1.00
SBD 3.88