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
This commit is contained in:
Joe Vilches
2024-07-24 14:00:05 -07:00
committed by Facebook GitHub Bot
parent f9ac5b737a
commit 7ba801b7f0
@@ -832,6 +832,7 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
break;
}
[_boxShadowLayer removeFromSuperlayer];
_boxShadowLayer = nil;
if (!_props->boxShadow.empty()) {
_boxShadowLayer = [CALayer layer];