Static slot content vnode's el property remains null after the component is mounted
Vue version
3.2.40
Link to minimal reproduction
Steps to reproduce
See the vue sfc playground link.
What is expected?
Switch Vue version to 3.2.39, the output is the dom element which is correctA.
What is actually happening?
Switch Vue version to 3.2.40,the output is null which is wrong.
System Info
No response
Any additional comments?
No response
It should be caused by the change here. https://github.com/vuejs/core/blob/fc5bdb36ed429d6c3c956f373206ce75467adaf3/packages/runtime-core/src/vnode.ts#L738-L744
see #6591
As @zhangzhonghe said, when fixing bug #6591 , @yyx990803 removed the reference to the dom on the hoisted vnodes to avoid memory leaks, you can bind a key to avoid hoisted
<template>
<Comp><div key='wqewqewq'>
wqewqewq
</div></Comp>
</template>
OK, strictly speaking, it's an undocumented internal api change since 3.2.40. Let's see how can we proceed with this. One of our internal component library relies on this behavior, currently we have to lock the vue version to 3.2.39 for quick fix.
I don't think labeling this as an important bug is warranted. it's essentially an edge case when using an API that's not even public, strictly speaking.