From eac36022180d898e8348f8241a8b39307bb6c80d Mon Sep 17 00:00:00 2001 From: mmis1000 Date: Sat, 4 Nov 2023 01:05:53 +0800 Subject: [PATCH] chore(runtime-core): explain the async element initialVNode.el patching --- packages/runtime-core/src/renderer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 78f5c8693af..03f908b60df 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -1235,6 +1235,9 @@ function baseCreateRenderer( if (!initialVNode.el) { const placeholder = (instance.subTree = createVNode(Comment)) processCommentNode(null, placeholder, container!, anchor) + // This noramlly gets setup by the following `setupRenderEffect`. + // But the call is skipped in initial mounting of async element. + // Thus, manually patching is required here or it will result in a crash during parent component update. initialVNode.el = placeholder.el } return