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 1a4bf7b58bd..e07977cb8b4 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 @@ -508,6 +508,9 @@ void Binding::installFabricUIManager( enableFabricLogs_ = config->getBool("react_fabric:enabled_android_fabric_logs"); + disableRevisionCheckForPreallocation_ = + config->getBool("react_fabric:disable_revision_check_for_preallocation"); + if (enableFabricLogs_) { LOG(WARNING) << "Binding::installFabricUIManager() was called (address: " << this << ")."; @@ -1242,11 +1245,13 @@ void Binding::schedulerDidCloneShadowNode( // 1. The revision is exactly 1 // 2. At revision 0 (the old node), View Preallocation would have been skipped - if (newShadowNode.getProps()->revision != 1) { - return; - } - if (oldShadowNode.getProps()->revision != 0) { - return; + if (!disableRevisionCheckForPreallocation_) { + if (newShadowNode.getProps()->revision != 1) { + return; + } + if (oldShadowNode.getProps()->revision != 0) { + return; + } } // If the new node is concrete and the old wasn't, we can preallocate 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 5ae4f0189e2..9750a51bf23 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 @@ -201,6 +201,7 @@ class Binding : public jni::HybridClass, bool disablePreallocateViews_{false}; bool enableFabricLogs_{false}; bool enableEarlyEventEmitterUpdate_{false}; + bool disableRevisionCheckForPreallocation_{false}; }; } // namespace react diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java index f93d1c20dca..737a29559aa 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java @@ -910,10 +910,6 @@ public class SurfaceMountingManager { // We treat this as a perf problem and not a logical error. View Preallocation or unexpected // changes to Differ or C++ Binding could cause some redundant Create instructions. if (getNullableViewState(reactTag) != null) { - ReactSoftExceptionLogger.logSoftException( - TAG, - new IllegalStateException( - "Cannot Preallocate view with tag [" + reactTag + "], already exists.")); return; }