Fix commands not always going through with Nodes

Summary:
Previously, to fix the issue of commands happening before the Views
were made and attached to the hierarchy, a check was added to see if a node
had not been mounted to a View, to update its hierarchy. In reality, we need
to do this irrespective, since a node could be mounted to a View, but its
children may not yet be attached, for example. Note that if there is nothing
to be done, this won't do extra work (i.e. applyUpdates recursively goes
through the tree from the node on which we did the operation to apply updates,
but if there are no updates, we stop traversing that praticular subtree).

Reviewed By: sriramramani

Differential Revision: D3511462
This commit is contained in:
Ahmed El-Helw
2016-07-01 16:22:28 -07:00
parent 4622532ca4
commit 87eb779eea
2 changed files with 6 additions and 16 deletions

View File

@@ -154,16 +154,15 @@ import com.facebook.react.uimanager.events.EventDispatcher;
}
}
/* package */ boolean ensureBackingViewIsCreated(FlatShadowNode node) {
/* package */ void ensureBackingViewIsCreated(FlatShadowNode node) {
if (node.isBackingViewCreated()) {
return false;
return;
}
int tag = node.getReactTag();
mOperationsQueue.enqueueCreateView(node.getThemedContext(), tag, node.getViewClass(), null);
node.signalBackingViewIsCreated();
return true;
}
/* package */ void dropView(FlatShadowNode node) {