From defc0c8c21880836bd0ba8d1edf2dfd176bf7c6c Mon Sep 17 00:00:00 2001 From: Joe Vilches Date: Thu, 17 Oct 2024 11:58:12 -0700 Subject: [PATCH] Fix animating background colors in View (#47101) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47101 See https://github.com/facebook/react-native/issues/47011 borders do not have this problem because they call `removeAllAnimations` on the layer after changing it, which is what I am doing here Changelog: [iOS] [fixed] - Fixed bug where background colors would sometimes animate when changing on Views Reviewed By: cipolleschi Differential Revision: D64493968 fbshipit-source-id: cf81549f21b124b67c6e7647c6ae827bfe80a9cf --- .../Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm | 2 ++ 1 file changed, 2 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 bcebeda597d..2f0e23f5209 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -833,6 +833,8 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle) _backgroundColorLayer.mask = maskLayer; _backgroundColorLayer.cornerRadius = 0; } + + [_backgroundColorLayer removeAllAnimations]; } // borders