Skip to content

Commit f300a40

Browse files
authored
fix(watch): remove instance unmounted short circuit in getter of watchEffect (#9948)
1 parent 6de0c55 commit f300a40

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/runtime-core/src/apiWatch.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
ReactiveEffect,
66
ReactiveFlags,
77
type Ref,
8-
getCurrentScope,
98
isReactive,
109
isRef,
1110
isShallow,
@@ -220,8 +219,7 @@ function doWatch(
220219
)
221220
}
222221

223-
const instance =
224-
getCurrentScope() === currentInstance?.scope ? currentInstance : null
222+
const instance = currentInstance
225223
const reactiveGetter = (source: object) =>
226224
deep === true
227225
? source // traverse will happen in wrapped getter below
@@ -261,9 +259,6 @@ function doWatch(
261259
} else {
262260
// no cb -> simple effect
263261
getter = () => {
264-
if (instance && instance.isUnmounted) {
265-
return
266-
}
267262
if (cleanup) {
268263
cleanup()
269264
}

0 commit comments

Comments
 (0)