From 2777c6572a96301bccdc2114691e46d1e42fb56c Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 3 Apr 2019 17:27:08 -0700 Subject: [PATCH] Pre-allocate Fabric views even when React is running in the UI Thread Summary: Before D14297477, the pre-allocation of views was ONLY necessary when react was running in the JS Thread, this is because the batch of mount items used to contain mount items for creation of views. After D14297477, views are only created during pre-allocation, that means that pre-allocation of views need to be trated the same way independently the thread where it is running. Reviewed By: shergin Differential Revision: D14714933 fbshipit-source-id: 7bd19cd33b624a5b0daaafabb476bb06707eea17 --- .../main/java/com/facebook/react/fabric/FabricUIManager.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java index 11b95ef994..552757b270 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java @@ -185,11 +185,6 @@ public class FabricUIManager implements UIManager, LifecycleEventListener { final String componentName, ReadableMap props, boolean isLayoutable) { - if (UiThreadUtil.isOnUiThread()) { - // There is no reason to allocate views ahead of time on the main thread. - return; - } - ThemedReactContext context = mReactContextForRootTag.get(rootTag); String component = sComponentNames.get(componentName); synchronized (mPreMountItemsLock) {