Enable update of props during preallocation for all views

Summary:
Before only the props of Images components were being applied during the pre-allocation phase.
Now that we have a limit of time that pre-allocations will be executed we can update props for any component

Reviewed By: shergin

Differential Revision: D14252171

fbshipit-source-id: afea4b71a32b7ae2c184b0cdce97f778bc3a47d2
This commit is contained in:
David Vacca
2019-03-03 08:55:25 -08:00
committed by Facebook Github Bot
parent ed8573f957
commit f6ba52bf1e
3 changed files with 6 additions and 10 deletions

View File

@@ -468,9 +468,7 @@ void Binding::schedulerDidRequestPreliminaryViewAllocation(
jni::findClassStatic(UIManagerJavaDescriptor)
->getMethod<void(jint, jint, jstring, ReadableMap::javaobject)>("preallocateView");
// TODO: T31905686 Experiment to check what is the impact on TTI of pre loading of Images during
// pre-allocation of views
if (shadowView.componentName == "Image") {
if (shadowView.props->rawProps.isNull()) {
local_ref<ReadableMap::javaobject> readableMap =
castReadableMap(ReadableNativeMap::newObjectCxxArgs(shadowView.props->rawProps));
preallocateView(

View File

@@ -26,7 +26,6 @@ public class DispatchCommandMountItem implements MountItem {
@Override
public void execute(MountingManager mountingManager) {
UiThreadUtil.assertOnUiThread();
mountingManager.receiveCommand(mReactTag, mCommandId, mCommandArgs);
}

View File

@@ -1,8 +1,8 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.facebook.react.fabric.mounting.mountitems;
@@ -10,9 +10,7 @@ import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.fabric.mounting.MountingManager;
import com.facebook.react.uimanager.ThemedReactContext;
/**
* {@link MountItem} that is used to pre-allocate views for JS components.
*/
/** {@link MountItem} that is used to pre-allocate views for JS components. */
public class PreAllocateViewMountItem implements MountItem {
private final String mComponent;
@@ -21,7 +19,8 @@ public class PreAllocateViewMountItem implements MountItem {
private final ReadableMap mProps;
private final ThemedReactContext mContext;
public PreAllocateViewMountItem(ThemedReactContext context, int rootTag, int reactTag, String component, ReadableMap props){
public PreAllocateViewMountItem(
ThemedReactContext context, int rootTag, int reactTag, String component, ReadableMap props) {
mContext = context;
mComponent = component;
mRootTag = rootTag;