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

Dep collection not paused during first invocation of immediate watchers, leading to unnecessary re-render #11942

Closed
delaneyb opened this issue Mar 7, 2021 · 0 comments · Fixed by #11943

Comments

@delaneyb
Copy link
Contributor

delaneyb commented Mar 7, 2021

Version

2.6.11

Reproduction link

https://jsfiddle.net/gyejmL14/32/

Steps to reproduce

Press the button "change value of testKey".

What is expected?

No components should be updated

What is actually happening?

The root components render function is being run again.

During component-a's creation, the immediate watcher for testKey is invoked without a pushTarget(). At this point the updateComponent() of the parent is still the Dep.target. Everything accessed within the immediate watcher is then collected as a dependency of the parents updateComponent watcher. When the button is then pressed, this triggers an unnecessary update of the Root component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants