mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Disable yellow box warnings based on environment variable
Summary: This adds a hook to let you disable yellow box warnings. It's useful for native engineers who don't want to mess with JS but also for CI/testing, where the app operates mostly as a blackbox. Depends on D4395091 Reviewed By: achen1 Differential Revision: D4395552 fbshipit-source-id: 4c3a9676caa975c537d1a4711d60aab2f404db15
This commit is contained in:
committed by
Facebook Github Bot
parent
91b7499cf6
commit
49d7c00500
@@ -69,6 +69,11 @@ if (__DEV__) {
|
||||
warn.apply(console, arguments);
|
||||
updateWarningMap.apply(null, arguments);
|
||||
};
|
||||
|
||||
const ProcessInfo = require('NativeModules').ProcessInfo;
|
||||
if (ProcessInfo && ProcessInfo.environment.DISABLE_YELLOW_BOX) {
|
||||
(console: any).disableYellowBox = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user