import { Directive, validateDirectiveName } from './directives'
import { RootRenderFunction } from './renderer'
import { InjectionKey } from './apiInject'
-import { isFunction, NO } from '@vue/shared'
+import { isFunction, NO, isObject } from '@vue/shared'
import { warn } from './warning'
import { createVNode } from './vnode'
mount(
rootComponent: Component,
rootContainer: HostElement,
- rootProps?: Data
+ rootProps?: Data | null
): any {
if (!isMounted) {
+ if (!isObject(rootProps)) {
+ __DEV__ &&
+ warn(`root props passed to app.mount() must be an object.`)
+ rootProps = null
+ }
const vnode = createVNode(rootComponent, rootProps)
// store app context on the root VNode.
// this will be set on the root instance on initial mount.