mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-07 07:07:37 +08:00
The warning 'cannot calculate shadow efficiently' is not a warning anymore
Reviewed By: fkgozali, yungsters Differential Revision: D4445304 fbshipit-source-id: 3a37150ae2beaf44b505dc36b575b7d44619e071
This commit is contained in:
committed by
Facebook Github Bot
parent
e97ffc469c
commit
64041669ee
@@ -57,6 +57,7 @@ const _warningMap: Map<string, WarningInfo> = new Map();
|
||||
|
||||
if (__DEV__) {
|
||||
const {error, warn} = console;
|
||||
|
||||
(console: any).error = function() {
|
||||
error.apply(console, arguments);
|
||||
// Show yellow box for the `warning` module.
|
||||
@@ -65,8 +66,15 @@ if (__DEV__) {
|
||||
updateWarningMap.apply(null, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
(console: any).warn = function() {
|
||||
warn.apply(console, arguments);
|
||||
|
||||
if (typeof arguments[0] === 'string' &&
|
||||
arguments[0].startsWith('(ADVICE)')) {
|
||||
return;
|
||||
}
|
||||
|
||||
updateWarningMap.apply(null, arguments);
|
||||
};
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define RCTLog(...) _RCTLog(RCTLogLevelInfo, __VA_ARGS__)
|
||||
#define RCTLogTrace(...) _RCTLog(RCTLogLevelTrace, __VA_ARGS__)
|
||||
#define RCTLogInfo(...) _RCTLog(RCTLogLevelInfo, __VA_ARGS__)
|
||||
#define RCTLogAdvice(string, ...) RCTLogWarn([@"(ADVICE) " stringByAppendingString:(NSString *)string], __VA_ARGS__)
|
||||
#define RCTLogWarn(...) _RCTLog(RCTLogLevelWarning, __VA_ARGS__)
|
||||
#define RCTLogError(...) _RCTLog(RCTLogLevelError, __VA_ARGS__)
|
||||
|
||||
|
||||
@@ -575,10 +575,10 @@ static void RCTUpdateShadowPathForView(RCTView *view)
|
||||
// Can't accurately calculate box shadow, so fall back to pixel-based shadow
|
||||
view.layer.shadowPath = nil;
|
||||
|
||||
RCTLogWarn(@"View #%@ of type %@ has a shadow set but cannot calculate "
|
||||
"shadow efficiently. Consider setting a background color to "
|
||||
"fix this, or apply the shadow to a more specific component.",
|
||||
view.reactTag, [view class]);
|
||||
RCTLogAdvice(@"View #%@ of type %@ has a shadow set but cannot calculate "
|
||||
"shadow efficiently. Consider setting a background color to "
|
||||
"fix this, or apply the shadow to a more specific component.",
|
||||
view.reactTag, [view class]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user