Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use strict equality checks when comparing VNode type #2855

Merged
merged 1 commit into from Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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