import { warn } from './warning'
let currentVNode: VNode | null = null
-let currentContextVNode: MountedVNode | null = null
+let currentContextVNode: VNode | null = null
export function createComponentInstance(
vnode: VNode,
- Component: ComponentClass,
- contextVNode: MountedVNode | null
+ Component: ComponentClass
): ComponentInstance {
// component instance creation is done in two steps.
// first, `initializeComponentInstance` is called inside base component
// we are storing the vnodes in variables here so that there's no need to
// always pass args in super()
currentVNode = vnode
- currentContextVNode = contextVNode
+ currentContextVNode = vnode.contextVNode
const instance = (vnode.children = new Component() as ComponentInstance)
// then we finish the initialization by collecting properties set on the
// instance
}
const { flags } = vnode
if (flags & VNodeFlags.COMPONENT_STATEFUL) {
- mountStatefulComponent(vnode, container, contextVNode, isSVG, endNode)
+ mountStatefulComponent(vnode, container, isSVG, endNode)
} else {
- mountFunctionalComponent(vnode, container, contextVNode, isSVG, endNode)
+ mountFunctionalComponent(vnode, container, isSVG, endNode)
}
if (__DEV__) {
popContext()
function mountStatefulComponent(
vnode: VNode,
container: RenderNode | null,
- contextVNode: MountedVNode | null,
isSVG: boolean,
endNode: RenderNode | null
) {
vnode,
vnode.tag as ComponentClass,
container,
- contextVNode,
isSVG,
endNode
)
function mountFunctionalComponent(
vnode: VNode,
container: RenderNode | null,
- contextVNode: MountedVNode | null,
isSVG: boolean,
endNode: RenderNode | null
) {
vnode: VNode,
Component: ComponentClass,
container: RenderNode | null,
- contextVNode: MountedVNode | null,
isSVG: boolean,
endNode: RenderNode | null
): RenderNode {
// new Vue()
const instance =
(__COMPAT__ && (vnode.children as ComponentInstance)) ||
- createComponentInstance(vnode, Component, contextVNode)
+ createComponentInstance(vnode, Component)
// inject platform-specific unmount to keep-alive container
if ((Component as any)[KeepAliveSymbol] === true) {