From 6ffc93d6573839eb4c38e107fd35fc4c92b73d2a Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Thu, 31 Oct 2019 09:36:42 -0700 Subject: [PATCH] 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 --- ReactCommon/fabric/mounting/ShadowTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/fabric/mounting/ShadowTree.cpp b/ReactCommon/fabric/mounting/ShadowTree.cpp index f62c242b8d6..f37b1b30316 100644 --- a/ReactCommon/fabric/mounting/ShadowTree.cpp +++ b/ReactCommon/fabric/mounting/ShadowTree.cpp @@ -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; }