diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index fc2db5f8cdf..0747f8e1314 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -221,9 +221,8 @@ export function toRef( object: T, key: K ): ToRef { - return isRef(object[key]) - ? object[key] - : (new ObjectRefImpl(object, key) as any) + const val = object[key] + return isRef(val) ? val : (new ObjectRefImpl(object, key) as any) } // corner case when use narrows type