Subscribe on changes!

werid render when using computed and h function

avatar
Oct 19th 2022

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

avatar
Oct 19th 2022

More simplified reproduction.

The _unref(HelloWorld) causes the HelloWorld component to be treated as a dynamic node of the Comp component. 2459ef734a565104d436cbdcfe2ec6f

avatar
Nov 8th 2022

More simplified reproduction.

The _unref(HelloWorld) causes the HelloWorld component to be treated as a dynamic node of the Comp component. 2459ef734a565104d436cbdcfe2ec6f

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

avatar
Nov 9th 2022

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