Skip to content

Fix empty children #4822

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

Open
wants to merge 1 commit into
base: v10.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/diff/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export function diff(
}
} else {
newVNode._dom = oldVNode._dom;
newVNode._children = oldVNode._children;
newVNode._children = oldVNode._children || [];
Copy link
Member

@rschristian rschristian Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
newVNode._children = oldVNode._children || [];
newVNode._children = oldVNode._children || EMPTY_ARR;

Will need to add it as an import tho, wish GH allowed users to suggest outside the diff.

Weird that the CI is failing. Edit: Ah, looks like we'll need to manually upload something to get the 10.x line working again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would add a small comment here too on why we set it to a default value (e.g. point to prefresh issue)

}
options._catchError(e, newVNode, oldVNode);
}
Expand Down
Loading