Skip to content

Commit

Permalink
compare type and name for replace node
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Jun 12, 2019
1 parent 03ced07 commit 8dca414
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/moon/dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -1176,9 +1176,9 @@
var nodeNew = executeComponent(nodesNew.pop()); // If they have the same reference (hoisted) then skip diffing.

if (nodeOldNode !== nodeNew) {
if (nodeOldNode.name !== nodeNew.name) {
// If they have different names, then replace the old node with the
// new one.
if (nodeOldNode.type !== nodeNew.type || nodeOldNode.name !== nodeNew.name) {
// If they have different types or names, then replace the old node
// with the new one.
patches.push({
type: patchTypes.replaceNode,
nodeOld: nodeOld,
Expand Down
2 changes: 1 addition & 1 deletion packages/moon/dist/moon.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8dca414

Please sign in to comment.