From eb4d3892abf79cd01757b6c3021d39be58d64ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanno=20J=2E=20G=C3=B6decke?= Date: Tue, 21 Jul 2026 12:37:31 -0700 Subject: [PATCH] fix(ios): add log advice back when using shadow w/o a background (#57618) Summary: Back on old arch in RCTView.m we printed that warning: https://github.com/react/react-native/blob/d13d2b0a5f7329d5fe9262259e8f846a86312f03/packages/react-native/React/Views/RCTView.m#L898-L906 This was missing on new arch and due to it we were missing some unoptimized views in our app which tanked performance. ## Changelog: [IOS] [ADDED] - Print warning advice when using `shadow*` styles without providing a solid background color Pull Request resolved: https://github.com/react/react-native/pull/57618 Test Plan: In rn-tester go to APIs > Box Shadow example to see the warnings printed! Reviewed By: shwanton Differential Revision: D113008257 Pulled By: fabriziocucci fbshipit-source-id: 912224c426641325e010ebf261ea56f0b5dfa085 --- .../Mounting/ComponentViews/View/RCTViewComponentView.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index 5571b5350bf..fc4493544f3 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -21,6 +21,7 @@ #import #import #import +#import #import #import #import @@ -1009,6 +1010,13 @@ static RCTBorderStyle RCTBorderStyleFromOutlineStyle(OutlineStyle outlineStyle) } else { // Can't accurately calculate box shadow, so fall back to pixel-based shadow. layer.shadowPath = nil; + + RCTLogAdvice( + @"View #%ld of type %@ has a shadow set but cannot calculate " + "shadow efficiently. Consider setting a solid background color to " + "fix this or applying the shadow to a more specific component.", + (long)self.tag, + [self class]); } } else { layer.shadowPath = nil;