Subscribe on changes!

HMR not updating props in nested non-sfc components

avatar
May 23rd 2021

Version

3.1.0-beta.3

Reproduction link

https://github.com/gzzhanghao/vue-next-props-update-issue-demo

Steps to reproduce

With following component structure (A and B are non-sfc components), update class="b" to class="c".

<A>
  <B class="b" :data-foo="dynamic" />
</A>

What is expected?

Element's class is updated to c.

What is actually happening?

Nothing happened.


See https://github.com/vuejs/vue-next/blob/f7c54caeb1dac69a26b79c98409e9633a7fe4bd3/packages/runtime-core/src/componentProps.ts#L201

instance.parent is not referring to the component that creates the vnode. In the example above, B.parent points to A instead of App.