Component Watch Survives if the watched property is a store Property #1328
-
ReproductionIn the description Steps to reproduce the bugHave a Component mounted witch is watching a property of the store, via storeToRefs, recreate the component by changeing its :key property, see the component console.log unmounted and mounted again, mutate the state of the store property, see the watch triggering twice. My App.vue: My Component:
As you can see the component is mounting with a controll ID, and when i mutate the state the watch is triggering as expected, after i recreate the component with changing its key property, the component unmounts wth the ID and mounts with the new ID. After mutating the state the old watch is still triggering: Expected behaviorExpect the watch to be destoryed when the component unmounts. Actual behaviorThe watch is triggering twice after the component is unmounted Additional informationI also want to be honest and say that i could no recreate this scenario in a different webpack 5 project, but then again i removed everything from my App beside the App.vue thats the entry point and the Test Component. On a side note, if i manually const unwatch = watch() ..... unwatch() in the onUnmounted it works as expected, but this is not how it suposed to be i think. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I couldn't reproduce it either. Maybe you have outdated versions? Let me know if you manage to reproduce but also please don't open issues without a reproduction 🙏 |
Beta Was this translation helpful? Give feedback.
I couldn't reproduce it either. Maybe you have outdated versions? Let me know if you manage to reproduce but also please don't open issues without a reproduction 🙏