We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24d77c2 commit f8ea946Copy full SHA for f8ea946
packages/runtime-core/src/apiWatch.ts
@@ -220,8 +220,8 @@ function doWatch(
220
)
221
}
222
223
- const instance =
224
- getCurrentScope() === currentInstance?.scope ? currentInstance : null
+ const scope = getCurrentScope()
+ const instance = currentInstance
225
const reactiveGetter = (source: object) =>
226
deep === true
227
? source // traverse will happen in wrapped getter below
@@ -261,7 +261,7 @@ function doWatch(
261
} else {
262
// no cb -> simple effect
263
getter = () => {
264
- if (instance && instance.isUnmounted) {
+ if (scope && !scope.active) {
265
return
266
267
if (cleanup) {
0 commit comments