Fix StateBuilder incorrectly casting a child to FlatShadowNode
Summary: Not every CSSNode in a hierarchy is a FlatShadowNode, some virtual nodes can be ReactShadowNodes for compatibility with ART nodes. This diff fixes StateBuilder unconditionally casting a node to FlatShadowNode, which is causing a crash in Groups. Reviewed By: nickholub Differential Revision: D2941031
This commit is contained in:
parent
d1ccb6d23d
commit
b461c70b76
|
@ -13,9 +13,9 @@ import javax.annotation.Nullable;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.facebook.csslayout.CSSNode;
|
||||
import com.facebook.csslayout.Spacing;
|
||||
import com.facebook.react.uimanager.OnLayoutEvent;
|
||||
import com.facebook.react.uimanager.ReactShadowNode;
|
||||
import com.facebook.react.uimanager.ReactStylesDiffMap;
|
||||
import com.facebook.react.uimanager.events.EventDispatcher;
|
||||
|
||||
|
@ -387,14 +387,14 @@ import com.facebook.react.uimanager.events.EventDispatcher;
|
|||
node.collectState(this, left, top, right, bottom, clipLeft, clipTop, clipRight, clipBottom);
|
||||
|
||||
for (int i = 0, childCount = node.getChildCount(); i != childCount; ++i) {
|
||||
FlatShadowNode child = (FlatShadowNode) node.getChildAt(i);
|
||||
ReactShadowNode child = node.getChildAt(i);
|
||||
if (child.isVirtual()) {
|
||||
markLayoutSeenRecursively(child);
|
||||
continue;
|
||||
}
|
||||
|
||||
processNodeAndCollectState(
|
||||
child,
|
||||
(FlatShadowNode) child,
|
||||
left,
|
||||
top,
|
||||
clipLeft,
|
||||
|
@ -406,7 +406,7 @@ import com.facebook.react.uimanager.events.EventDispatcher;
|
|||
}
|
||||
}
|
||||
|
||||
private void markLayoutSeenRecursively(CSSNode node) {
|
||||
private void markLayoutSeenRecursively(ReactShadowNode node) {
|
||||
if (node.hasNewLayout()) {
|
||||
node.markLayoutSeen();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue