Skip to content

Commit

Permalink
perf: avoid parentNode call when dynamic child is not a Fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 11, 2019
1 parent a42ad6c commit 1b06b3c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/runtime-core/src/createRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,11 @@ export function createRenderer<
patch(
oldVNode,
dynamicChildren[i],
hostParentNode(oldVNode.el!)!,
// in the case of a Fragment, we need to provide the actual parent
// of the Fragment itself so it can move its children. In other cases,
// the parent container is not actually used so we just pass the
// block element here to avoid a DOM parentNode call.
oldVNode.type === Fragment ? hostParentNode(oldVNode.el!)! : el,
null,
parentComponent,
parentSuspense,
Expand Down

0 comments on commit 1b06b3c

Please sign in to comment.