From 732a3f2691e8005ec1d35705fae6bca51597a42a Mon Sep 17 00:00:00 2001 From: yingpengsha Date: Mon, 22 Apr 2024 17:59:45 +0800 Subject: [PATCH 1/2] fix(runtime-core): when props are of type ref, they lose data and don't stay responsive --- packages/runtime-core/src/vnode.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index a1a6a908d2a..865dd6f49a7 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -617,6 +617,9 @@ function _createVNode( export function guardReactiveProps(props: (Data & VNodeProps) | null) { if (!props) return null + if (isRef(props)) { + return { value: props.value } + } return isProxy(props) || isInternalObject(props) ? extend({}, props) : props } From 0e7a5db19771a290d66c37fdcdab2bc5d11149cc Mon Sep 17 00:00:00 2001 From: yingpengsha Date: Mon, 22 Apr 2024 18:12:39 +0800 Subject: [PATCH 2/2] style: useless space --- packages/runtime-core/src/vnode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index 865dd6f49a7..66da85773ae 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -618,7 +618,7 @@ function _createVNode( export function guardReactiveProps(props: (Data & VNodeProps) | null) { if (!props) return null if (isRef(props)) { - return { value: props.value } + return { value: props.value } } return isProxy(props) || isInternalObject(props) ? extend({}, props) : props }