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 bf6495340eb7cb..b80b5109f3010e 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 @@ -367,6 +367,9 @@ void Binding::installFabricUIManager( disableRevisionCheckForPreallocation_ = config->getBool("react_fabric:disable_revision_check_for_preallocation"); + disablePreallocationOnClone_ = config->getBool( + "react_native_new_architecture:disable_preallocation_on_clone_android"); + if (enableFabricLogs_) { LOG(WARNING) << "Binding::installFabricUIManager() was called (address: " << this << ")."; @@ -505,6 +508,9 @@ void Binding::schedulerDidCloneShadowNode( SurfaceId surfaceId, ShadowNode const &oldShadowNode, ShadowNode const &newShadowNode) { + if (disablePreallocationOnClone_) { + return; + } // This is only necessary if view preallocation was skipped during // createShadowNode diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h index 90099106bbfc32..b7df029f3d2ed7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h @@ -156,6 +156,7 @@ class Binding : public jni::HybridClass, bool enableFabricLogs_{false}; bool disableRevisionCheckForPreallocation_{false}; bool dispatchPreallocationInBackground_{false}; + bool disablePreallocationOnClone_{false}; }; } // namespace react