wip: always track component nodes

This commit is contained in:
Evan You
2019-06-01 02:14:49 +08:00
parent da5edd3429
commit 05556eacb2
4 changed files with 21 additions and 14 deletions

View File

@@ -163,7 +163,8 @@ export function renderComponentRoot(instance: ComponentInstance): VNode {
export function shouldUpdateComponent(
prevVNode: VNode,
nextVNode: VNode
nextVNode: VNode,
optimized?: boolean
): boolean {
const { props: prevProps, children: prevChildren } = prevVNode
const { props: nextProps, children: nextChildren, patchFlag } = nextVNode
@@ -185,7 +186,7 @@ export function shouldUpdateComponent(
}
}
}
} else {
} else if (!optimized) {
// this path is only taken by manually written render functions
// so presence of any children leads to a forced update
if (prevChildren != null || nextChildren != null) {