werid render when using computed and h function
Vue version
3.2.33
Link to minimal reproduction
https://codesandbox.io/s/xenodochial-dijkstra-b55ltd?file=/src/components/HelloWorld.vue
Steps to reproduce
using above link, using case 2
What is expected?
just msg
turn to 2, other elements do not rerender
What is actually happening?
arrow
is rerender, and also disappear
System Info
No response
Any additional comments?
No response
More simplified reproduction.
The _unref(HelloWorld)
causes the HelloWorld
component to be treated as a dynamic node of the Comp
component.
More simplified reproduction.
The
_unref(HelloWorld)
causes theHelloWorld
component to be treated as a dynamic node of theComp
component.
i find that just render
<template>
<div>
<t-node :content="HelloWorld" />
</div>
{{ num }}
</template>
when 1000ms later,it show error "Uncaught (in promise): Cannot read properties of null (reading 'insertBefore')" Is this also a bug?see here
further investigate. The dynamicChildrens amount are different In two updates,this will cause bug. the main reason is computed will cache node, computed gets called the first time, but not the second time.so dynamicChildren will just collect HelloWorld in the first Time
a workaround see https://github.com/vuejs/core/issues/8203#issuecomment-1531347186