Skip to content

Commit

Permalink
chore(runtime-core): explain the async element initialVNode.el patching
Browse files Browse the repository at this point in the history
  • Loading branch information
mmis1000 committed Nov 3, 2023
1 parent 19d8b77 commit eac3602
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eac3602

Please sign in to comment.