Subscribe on changes!

Component slots not rendering with 2 forwarded slots

avatar
Aug 4th 2021

Version

3.2.0-beta.7

Reproduction link

Reporduction link

Steps to reproduce

Press the increment count button

What is expected?

The counts should be the same

What is actually happening?

The count in the default slot of the child is not re-rendering. So the count is not the same.

avatar
Aug 4th 2021

You can use a regular ref as a workaround

avatar
Aug 4th 2021

Thanks @posva, I just used shallowRef as a mock computed.

avatar
Aug 5th 2021

case by 68365b9b2bc2ccef93e88475c4f15e7cfb4f2497

works fine in v3.1.4 use a regular ref is works weird when patch. you'll notice that it doesn't patch in the order of the child nodes when you debugging So I think if dynamicChildren is empty should not take the fast path. image

avatar
Aug 6th 2021

I think the cause is the slot hint. In this case,the outer Forward's slot hint is Stable,but the inner Forward's slot hint is Dynamic.When Child component updates,the outer Forward will not update because of the Stable hint.But component with dynamic slot does not track it own dependence.The inner Forward's re-render rely on the outer Forward, so it will not update. Look this example works well. I will commit a PR to solve it.