fix(watch): remove instance unmounted short circuit in getter of `watchEffect` (#9948)

This commit is contained in:
Yang Mingshan 2024-01-03 18:09:53 +08:00 committed by GitHub
parent 6de0c55661
commit f300a4001e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -5,7 +5,6 @@ import {
ReactiveEffect,
ReactiveFlags,
type Ref,
getCurrentScope,
isReactive,
isRef,
isShallow,
@ -220,8 +219,7 @@ function doWatch(
)
}
const instance =
getCurrentScope() === currentInstance?.scope ? currentInstance : null
const instance = currentInstance
const reactiveGetter = (source: object) =>
deep === true
? source // traverse will happen in wrapped getter below
@ -261,9 +259,6 @@ function doWatch(
} else {
// no cb -> simple effect
getter = () => {
if (instance && instance.isUnmounted) {
return
}
if (cleanup) {
cleanup()
}