Skip to content

Commit 713567a

Browse files
committed
fix(ios): add log advice back when using shadow w/o a background
Back on old arch in RCTView.m we printed that warning. Due to this we were missing some unoptimized views in our app which tanked performance.
1 parent 5070236 commit 713567a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#import <React/RCTConversions.h>
2222
#import <React/RCTLinearGradient.h>
2323
#import <React/RCTLocalizedString.h>
24+
#import <React/RCTLog.h>
2425
#import <React/RCTRadialGradient.h>
2526
#import <react/featureflags/ReactNativeFeatureFlags.h>
2627
#import <react/renderer/components/view/ViewComponentDescriptor.h>
@@ -1009,6 +1010,13 @@ - (void)invalidateLayer
10091010
} else {
10101011
// Can't accurately calculate box shadow, so fall back to pixel-based shadow.
10111012
layer.shadowPath = nil;
1013+
1014+
RCTLogAdvice(
1015+
@"View #%ld of type %@ has a shadow set but cannot calculate "
1016+
"shadow efficiently. Consider setting a solid background color to "
1017+
"fix this, or apply the shadow to a more specific component.",
1018+
(long)self.tag,
1019+
[self class]);
10121020
}
10131021
} else {
10141022
layer.shadowPath = nil;

0 commit comments

Comments
 (0)