Skip to content

Commit 2d4ad8a

Browse files
author
FatRadish
committed
fix(reactivity): enhance reactive function to handle the WeakMap key
close #12807
1 parent 119f18c commit 2d4ad8a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/reactivity/src/reactive.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,16 +279,16 @@ function createReactiveObject(
279279
) {
280280
return target
281281
}
282-
// target already has corresponding Proxy
283-
const existingProxy = proxyMap.get(target)
284-
if (existingProxy) {
285-
return existingProxy
286-
}
287282
// only specific value types can be observed.
288283
const targetType = getTargetType(target)
289284
if (targetType === TargetType.INVALID) {
290285
return target
291286
}
287+
// target already has corresponding Proxy
288+
const existingProxy = proxyMap.get(target)
289+
if (existingProxy) {
290+
return existingProxy
291+
}
292292
const proxy = new Proxy(
293293
target,
294294
targetType === TargetType.COLLECTION ? collectionHandlers : baseHandlers,

0 commit comments

Comments
 (0)