Skip to content

Commit 55ee4bc

Browse files
authored
(fix) - prevent eager child removal (#3210)
1 parent c52de5c commit 55ee4bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/diff/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { EMPTY_OBJ } from '../constants';
2-
import { Component } from '../component';
2+
import { Component, getDomSibling } from '../component';
33
import { Fragment } from '../create-element';
44
import { diffChildren } from './children';
55
import { diffProps, setProperty } from './props';
@@ -410,7 +410,9 @@ function diffElementNodes(
410410
isSvg && nodeType !== 'foreignObject',
411411
excessDomChildren,
412412
commitQueue,
413-
dom.firstChild,
413+
excessDomChildren
414+
? excessDomChildren[0]
415+
: oldVNode._children && getDomSibling(oldVNode, 0),
414416
isHydrating
415417
);
416418

0 commit comments

Comments
 (0)