From 75569ef92c7a2b8113acf09cd51e5ecfed71de99 Mon Sep 17 00:00:00 2001 From: mmis1000 Date: Sat, 28 Oct 2023 02:38:48 +0800 Subject: [PATCH] fix(runtime-core): Fix client side suspense hydration masmatch in proper way --- packages/runtime-core/src/renderer.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index fe4a6e33e50..78f5c8693af 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -1235,6 +1235,7 @@ function baseCreateRenderer( if (!initialVNode.el) { const placeholder = (instance.subTree = createVNode(Comment)) processCommentNode(null, placeholder, container!, anchor) + initialVNode.el = placeholder.el } return } @@ -1446,8 +1447,9 @@ function baseCreateRenderer( ): ComponentInternalInstance | null => { if (instance.subTree.shapeFlag & ShapeFlags.COMPONENT) { if ( - // this happens during hydration or updating a component that resolve to a unresolved async component - instance.subTree.component?.asyncDep != null && + // this happens only during hydration + instance.subTree.component?.subTree == null && + // we don't know the subTree yet because we haven't resolve it instance.subTree.component?.asyncResolved === false ) { return instance.subTree.component!