Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component slots not rendering with 2 forwarded slots #4244

Closed
robertmoura opened this issue Aug 4, 2021 · 4 comments · Fixed by #4268
Closed

Component slots not rendering with 2 forwarded slots #4244

robertmoura opened this issue Aug 4, 2021 · 4 comments · Fixed by #4268
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working scope: reactivity

Comments

@robertmoura
Copy link

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.

@posva posva added 🐞 bug Something isn't working 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: reactivity has workaround A workaround has been found to avoid the problem labels Aug 4, 2021
@posva
Copy link
Member

posva commented Aug 4, 2021

You can use a regular ref as a workaround

@robertmoura
Copy link
Author

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

@edison1105
Copy link
Member

edison1105 commented Aug 5, 2021

case by 68365b9

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

@Bigfish8
Copy link
Contributor

Bigfish8 commented Aug 6, 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working scope: reactivity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants