@@ -17,19 +17,16 @@ export function render(vnode, parentDom, replaceNode) {
1717 // We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in
1818 // hydration mode or not by passing the `hydrate` function instead of a DOM
1919 // element..
20- let isHydrating = typeof replaceNode == 'function' ;
20+ let isHydrating = replaceNode === hydrate ;
2121
2222 // To be able to support calling `render()` multiple times on the same
2323 // DOM node, we need to obtain a reference to the previous tree. We do
2424 // this by assigning a new `_children` property to DOM nodes which points
2525 // to the last rendered tree. By default this property is not present, which
2626 // means that we are mounting a new tree for the first time.
27- let oldVNode = isHydrating
28- ? null
29- : ( replaceNode && replaceNode . _children ) || parentDom . _children ;
27+ let oldVNode = isHydrating ? null : parentDom . _children ;
3028
31- vnode = ( ( ! isHydrating && replaceNode ) || parentDom ) . _children =
32- createElement ( Fragment , null , [ vnode ] ) ;
29+ vnode = parentDom . _children = createElement ( Fragment , null , [ vnode ] ) ;
3330
3431 // List of effects that need to be called after diffing.
3532 let commitQueue = [ ] ,
@@ -42,19 +39,13 @@ export function render(vnode, parentDom, replaceNode) {
4239 oldVNode || EMPTY_OBJ ,
4340 EMPTY_OBJ ,
4441 parentDom . namespaceURI ,
45- ! isHydrating && replaceNode
46- ? [ replaceNode ]
47- : oldVNode
48- ? null
49- : parentDom . firstChild
50- ? slice . call ( parentDom . childNodes )
51- : null ,
42+ oldVNode
43+ ? null
44+ : parentDom . firstChild
45+ ? slice . call ( parentDom . childNodes )
46+ : null ,
5247 commitQueue ,
53- ! isHydrating && replaceNode
54- ? replaceNode
55- : oldVNode
56- ? oldVNode . _dom
57- : parentDom . firstChild ,
48+ oldVNode ? oldVNode . _dom : parentDom . firstChild ,
5849 isHydrating ,
5950 refQueue
6051 ) ;
0 commit comments