From c774cb8ec50f652f19295f77169ba8a89c9657d4 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 16 Mar 2020 02:40:35 -0700 Subject: [PATCH] Remove unwanted animations Summary: Changelog: [internal] # Problem Assigning `CALayer.contents` implicitly animates the difference. As we keep `UIView` in recycle pool between usages, they keep their previous state. This was causing animation of border when the views were being reused. # Solution Wrapping application of mutations in `CATTransaction`. Reviewed By: shergin Differential Revision: D20442045 fbshipit-source-id: 214d6c422f23f399dec46b5bf1a38a7b64758160 --- React/Fabric/Mounting/RCTMountingManager.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/React/Fabric/Mounting/RCTMountingManager.mm b/React/Fabric/Mounting/RCTMountingManager.mm index b859710135..f0c690cd6d 100644 --- a/React/Fabric/Mounting/RCTMountingManager.mm +++ b/React/Fabric/Mounting/RCTMountingManager.mm @@ -135,6 +135,8 @@ static void RNPerformMountInstructions( { SystraceSection s("RNPerformMountInstructions"); + [CATransaction begin]; + [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; for (auto const &mutation : mutations) { switch (mutation.type) { case ShadowViewMutation::Create: { @@ -189,6 +191,7 @@ static void RNPerformMountInstructions( } } } + [CATransaction commit]; } @implementation RCTMountingManager {