Skip to content

Commit

Permalink
Check alternates when comparing to the common ancestor
Browse files Browse the repository at this point in the history
This is the actual bugfix.
  • Loading branch information
gaearon committed Oct 9, 2017
1 parent 79b84d8 commit 420b58a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/renderers/shared/shared/ReactTreeTraversal.js
Expand Up @@ -119,6 +119,10 @@ function traverseEnterLeave(from, to, fn, argFrom, argTo) {
if (from === common) {
break;
}
const alternate = from.alternate;
if (alternate !== null && alternate === common) {
break;
}
pathFrom.push(from);
from = getParent(from);
}
Expand All @@ -130,6 +134,10 @@ function traverseEnterLeave(from, to, fn, argFrom, argTo) {
if (to === common) {
break;
}
const alternate = to.alternate;
if (alternate !== null && alternate === common) {
break;
}
pathTo.push(to);
to = getParent(to);
}
Expand Down

0 comments on commit 420b58a

Please sign in to comment.