From 7ba801b7f0068d1c3d72b87f969a4bfca9ff9cc7 Mon Sep 17 00:00:00 2001 From: Joe Vilches Date: Wed, 24 Jul 2024 14:00:05 -0700 Subject: [PATCH] Fix issue where shadows were not being cleaned up (#45613) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45613 We had a bug where box shadows were not getting cleaned up. The fix here is easy - just call `[_boxShadowLayer removeFromSuperView]`. Previously we were just setting this layer to nil, which does not do the job. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D60137528 fbshipit-source-id: 310df944f63ffc73ee5fe938cfb5a48674f997ab --- .../Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm | 1 + 1 file changed, 1 insertion(+) 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 93340509beb..1022f30a5f3 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -832,6 +832,7 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle) break; } + [_boxShadowLayer removeFromSuperlayer]; _boxShadowLayer = nil; if (!_props->boxShadow.empty()) { _boxShadowLayer = [CALayer layer];