From 1e7da82623cb4aebbe41852baf899d09708b21ce Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Tue, 16 Nov 2021 11:48:12 -0800 Subject: [PATCH] Disable preallocation check on mount items Summary: Ensures (under a flag) that CREATE instructions will be issued even if the node was supposed to be preallocated before from create or clone. This addresses cases when differ considers nodes to be deleted->created, but we skip the "create" part because of revision check. Changelog: [Internal] Disable node revision checks during mount under a flag Reviewed By: sammy-SC Differential Revision: D32440831 fbshipit-source-id: 4da8c4961fd7bc43c8f4166798bdfb5d897184e0 --- .../main/java/com/facebook/react/fabric/jni/Binding.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp index 79b6c1ccf3a..a5f5236847a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp @@ -708,10 +708,12 @@ void Binding::schedulerDidFinishTransaction( bool isVirtual = mutation.mutatedViewIsVirtual(); + bool noRevisionCheck = + disablePreallocateViews_ || disableRevisionCheckForPreallocation_; + switch (mutationType) { case ShadowViewMutation::Create: { - if (disablePreallocateViews_ || - newChildShadowView.props->revision > 1) { + if (noRevisionCheck || newChildShadowView.props->revision > 1) { cppCommonMountItems.push_back( CppMountItem::CreateMountItem(newChildShadowView)); } @@ -772,8 +774,7 @@ void Binding::schedulerDidFinishTransaction( cppCommonMountItems.push_back(CppMountItem::InsertMountItem( parentShadowView, newChildShadowView, index)); - if (disablePreallocateViews_ || - newChildShadowView.props->revision > 1) { + if (noRevisionCheck || newChildShadowView.props->revision > 1) { cppUpdatePropsMountItems.push_back( CppMountItem::UpdatePropsMountItem(newChildShadowView)); }