Fabric: Use ShadowNode::sameFamily instead of getTag() to check for same family

Summary:
We used to use `getTag` to check that some two nodes are clones of each other, not we have a dedicated method for that that exactly ensures that without reling  on a sideeffect (wich tag equality is).
That is just much less error-prone.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D18231006

fbshipit-source-id: 6b247ed0eaded1fed8fd7fa820e80cd58602110c
This commit is contained in:
Valentin Shergin
2019-10-31 09:38:39 -07:00
committed by Facebook Github Bot
parent c5980a4b0f
commit 6ffc93d657
+1 -1
View File
@@ -59,7 +59,7 @@ static void updateMountedFlag(
continue;
}
if (oldChild->getTag() != newChild->getTag()) {
if (!ShadowNode::sameFamily(*oldChild, *newChild)) {
// Totally different nodes, updating is impossible.
break;
}