Skip to content

Commit d3b72c9

Browse files
ali-garajianJoviDeCroock
authored andcommitted
refactor(diff): set oldProps default value on declaration (#4959)
1 parent e06f8a5 commit d3b72c9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/diff/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ function diffElementNodes(
415415
isHydrating,
416416
refQueue
417417
) {
418-
let oldProps = oldVNode.props;
418+
let oldProps = oldVNode.props || EMPTY_OBJ;
419419
let newProps = newVNode.props;
420420
let nodeType = /** @type {string} */ (newVNode.type);
421421
/** @type {any} */
@@ -485,8 +485,6 @@ function diffElementNodes(
485485
// If excessDomChildren was not null, repopulate it with the current element's children:
486486
excessDomChildren = excessDomChildren && slice.call(dom.childNodes);
487487

488-
oldProps = oldVNode.props || EMPTY_OBJ;
489-
490488
// If we are in a situation where we are not hydrating but are using
491489
// existing DOM (e.g. replaceNode) we should read the existing DOM
492490
// attributes to diff them

0 commit comments

Comments
 (0)