From 6eea998cf0b6cee0dcaca4b3af7523f6f5dda1b8 Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Sat, 11 Nov 2023 11:27:34 +0100 Subject: [PATCH] more tries --- packages/core/src/index.js | 2 ++ packages/core/src/runtime/vnode.js | 14 ++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/core/src/index.js b/packages/core/src/index.js index 6c80ef4e..f4b8e596 100644 --- a/packages/core/src/index.js +++ b/packages/core/src/index.js @@ -98,6 +98,8 @@ function replaceComponent(OldType, NewType, resetHookState) { vnode[VNODE_COMPONENT].constructor = NewType; } + vnode[VNODE_COMPONENT].__v = vnode; + if (resetHookState) { if ( vnode[VNODE_COMPONENT][COMPONENT_HOOKS] && diff --git a/packages/core/src/runtime/vnode.js b/packages/core/src/runtime/vnode.js index f9a274b7..01c77d51 100644 --- a/packages/core/src/runtime/vnode.js +++ b/packages/core/src/runtime/vnode.js @@ -31,14 +31,12 @@ options.vnode = vnode => { } vnode.type = foundType; - if (vnode[VNODE_COMPONENT]) { - vnode[VNODE_COMPONENT].__v = vnode; - if ( - 'prototype' in vnode.type && - vnode.type.prototype.render - ) { - vnode[VNODE_COMPONENT].constructor = vnode.type; - } + if ( + vnode[VNODE_COMPONENT] && + 'prototype' in vnode.type && + vnode.type.prototype.render + ) { + vnode[VNODE_COMPONENT].constructor = vnode.type; } }