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

fix(runtime-core): before cloneIfMounted, should first check if the object is a VNode (#8778) #8784

Closed
wants to merge 1 commit into from

Conversation

higuaifan
Copy link

close #8778

In my opinion, it seems sufficient to directly check isVNode. However, should VNodeChild include the object type? For example, when using render!.call, it seems that we have no control over what it returns.

// already vnode, this should be the most common since compiled templates
// always produce all-vnode children arrays
return cloneIfMounted(child)
} else {
// strings and numbers
// strings and numbers or object that doesn't a vnode
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a warning or error would be more appropriate, rather than converting the object to a string.

@edison1105 edison1105 added 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. ready for review This PR requires more reviews labels Aug 20, 2024
@skirtles-code
Copy link
Contributor

Maybe superseded by #12038?

@edison1105
Copy link
Member

I'm really sorry, I didn't notice this PR before create https://github.com/vuejs/core/pull/12038.😓

@edison1105 edison1105 closed this Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. ready for review This PR requires more reviews
Projects
Status: Rejected
Development

Successfully merging this pull request may close these issues.

When render directly returns a custom object, will throw an uncaught TypeError.
3 participants