Don't collect state for virtual nodes

Summary: Virtual nodes (such as RCTRawText and RCTVirtualText) have no state or node regions, don't need to be laid out, and thus should not be checked for state.

Reviewed By: ahmedre

Differential Revision: D2757089
This commit is contained in:
Denis Koroskin 2015-12-15 22:31:29 -08:00 committed by Ahmed El-Helw
parent 312f04d2b7
commit e9753a11ae
1 changed files with 15 additions and 0 deletions

View File

@ -270,10 +270,25 @@ import com.facebook.react.uimanager.CatalystStylesDiffMap;
for (int i = 0, childCount = node.getChildCount(); i != childCount; ++i) {
FlatShadowNode child = (FlatShadowNode) node.getChildAt(i);
if (child.isVirtual()) {
markLayoutSeenRecursively(child);
continue;
}
processNodeAndCollectState(child, left, top, isAndroidView, needsCustomLayoutForChildren);
}
}
private void markLayoutSeenRecursively(FlatShadowNode node) {
if (node.hasNewLayout()) {
node.markLayoutSeen();
}
for (int i = 0, childCount = node.getChildCount(); i != childCount; ++i) {
markLayoutSeenRecursively((FlatShadowNode) node.getChildAt(i));
}
}
/**
* Collects state and updates View boundaries for a given node tree.
*/