[ReactNative] Don't redbox for React warnings when not using Chrome executor

This commit is contained in:
Ben Alpert 2015-08-17 14:56:10 -07:00
parent 4a0ff6a7d1
commit 801dd2d133
1 changed files with 6 additions and 0 deletions

View File

@ -376,6 +376,12 @@
var str = Array.prototype.map.call(arguments, function(arg) { var str = Array.prototype.map.call(arguments, function(arg) {
return inspect(arg, {depth: 10}); return inspect(arg, {depth: 10});
}).join(', '); }).join(', ');
if (str.slice(0, 10) === "'Warning: " && level >= LOG_LEVELS.error) {
// React warnings use console.error so that a stack trace is shown,
// but we don't (currently) want these to show a redbox
// (Note: Logic duplicated in ExceptionsManager.js.)
level = LOG_LEVELS.warn;
}
global.nativeLoggingHook(str, level); global.nativeLoggingHook(str, level);
}; };
} }