Skip to content

Commit

Permalink
fix(watch): remove instance unmounted short circuit in getter of `wat…
Browse files Browse the repository at this point in the history
…chEffect` (#9948)
  • Loading branch information
yangmingshan authored Jan 3, 2024
1 parent 6de0c55 commit f300a40
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/runtime-core/src/apiWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
ReactiveEffect,
ReactiveFlags,
type Ref,
getCurrentScope,
isReactive,
isRef,
isShallow,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -261,9 +259,6 @@ function doWatch(
} else {
// no cb -> simple effect
getter = () => {
if (instance && instance.isUnmounted) {
return
}
if (cleanup) {
cleanup()
}
Expand Down

0 comments on commit f300a40

Please sign in to comment.