Skip to content

Commit

Permalink
Use strict equality checks when comparing VNode type
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewiggins committed Nov 30, 2020
1 parent f955cfc commit 4e07e16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/diff/children.js
Expand Up @@ -196,7 +196,7 @@ export function diffChildren(
//
// To fix it we make sure to reset the inferred value, so that our own
// value check in `diff()` won't be skipped.
if (!isHydrating && newParentVNode.type == 'option') {
if (!isHydrating && newParentVNode.type === 'option') {
parentDom.value = '';
} else if (typeof newParentVNode.type == 'function') {
// Because the newParentVNode is Fragment-like, we need to set it's
Expand Down
2 changes: 1 addition & 1 deletion src/diff/index.js
Expand Up @@ -187,7 +187,7 @@ export function diff(
}

let isTopLevelFragment =
tmp != null && tmp.type == Fragment && tmp.key == null;
tmp != null && tmp.type === Fragment && tmp.key == null;
let renderResult = isTopLevelFragment ? tmp.props.children : tmp;

diffChildren(
Expand Down

0 comments on commit 4e07e16

Please sign in to comment.