From 08da2cda0b53709550479c8f35698b76becc23ab Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 22 Apr 2016 04:12:09 -0700 Subject: [PATCH] Document how to disable YellowBox Summary:As mentioned in #7121 by javache, this can already be disabled. Might be useful if users upgrade to 0.25 and want to hide warnings about wrong React imported (something they can't really control until community upgrades). This should be mentioned in the release notes once it's merged. Closes https://github.com/facebook/react-native/pull/7140 Differential Revision: D3212212 fb-gh-sync-id: 7a7afa2b7925e16d6ebfd20f4fe26d1cb9d603e5 fbshipit-source-id: 7a7afa2b7925e16d6ebfd20f4fe26d1cb9d603e5 --- docs/Debugging.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/Debugging.md b/docs/Debugging.md index d5373b79b08..bde4575ffa0 100644 --- a/docs/Debugging.md +++ b/docs/Debugging.md @@ -31,7 +31,16 @@ Using `console.warn` will display an on-screen log on a yellow background. Click You can use `console.error` to display a full screen error on a red background. -These boxes only appear when you're running your app in dev mode. +By default, the warning box is enabled in `__DEV__`. Set the following flag to disable it: +```js +console.disableYellowBox = true; +console.warn('YellowBox is disabled.'); +``` +Specific warnings can be ignored programmatically by setting the array: +```js +console.ignoredYellowBox = ['Warning: ...']; +``` +Strings in `console.ignoredYellowBox` can be a prefix of the warning that should be ignored. ### Chrome Developer Tools To debug the JavaScript code in Chrome, select `Debug JS Remotely` from the developer menu. This will open a new tab at [http://localhost:8081/debugger-ui](http://localhost:8081/debugger-ui).