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

Computed prop sometimes not updating in nested component #3404

Closed
plehnen opened this issue Mar 10, 2021 · 2 comments · Fixed by #3406
Closed

Computed prop sometimes not updating in nested component #3404

plehnen opened this issue Mar 10, 2021 · 2 comments · Fixed by #3406
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working

Comments

@plehnen
Copy link

plehnen commented Mar 10, 2021

Version

3.0.7

Reproduction link

https://codesandbox.io/s/reactivity-issue-demo-jbbme?file=/src/App.vue

Steps to reproduce

Please have a look at the minimal reproduction demo

What is expected?

All three (identical) components should behave identical

What is actually happening?

The second one doesn't update correctly


As requested I minimized the reproduction even more. The old link with more context still exists here: https://codesandbox.io/s/reactivity-issue-demo-h6mmz?file=/src/App.vue

(This more detailed demo is additionally emitting the selected tab, and this will cause the second - incorrectly rendered - component to update to a correct state as soon as the buttons inside the component are clicked)

@HcySunYang HcySunYang added the 🐞 bug Something isn't working label Mar 10, 2021
@edison1105
Copy link
Member

same as #2768 #2829
caused by #2567

@HcySunYang
Copy link
Member

HcySunYang commented Mar 11, 2021

Indeed, but strictly speaking it is different from #2768 #2829, but very similar. The reason is that the update of the child component causes the parent component's renderEffect to be enqueued (the child component registers its own reactivity data to the parent component through the injected callback function, then the parent component's renderEffect may be enqueued when the child component updating), and finally invalidates the job that has been executed. This PR is necessary, while still, we should accept @edison1105 's changes

@HcySunYang HcySunYang added the ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. label Mar 11, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants