refactor: adjust createApp related API signatures
BREAKING CHANGE: `createApp` API has been adjusted.
- `createApp()` now accepts the root component, and optionally a props
object to pass to the root component.
- `app.mount()` now accepts a single argument (the root container)
- `app.unmount()` no longer requires arguments.
New behavior looks like the following:
``` js
const app = createApp(RootComponent)
app.mount('#app')
app.unmount()
```
This commit is contained in:
@@ -46,7 +46,7 @@ import { ShapeFlags } from './shapeFlags'
|
||||
import { pushWarningContext, popWarningContext, warn } from './warning'
|
||||
import { invokeDirectiveHook } from './directives'
|
||||
import { ComponentPublicInstance } from './componentProxy'
|
||||
import { App, createAppAPI } from './apiCreateApp'
|
||||
import { createAppAPI, CreateAppFunction } from './apiCreateApp'
|
||||
import {
|
||||
SuspenseBoundary,
|
||||
queueEffectWithSuspense,
|
||||
@@ -174,7 +174,7 @@ export function createRenderer<
|
||||
options: RendererOptions<HostNode, HostElement>
|
||||
): {
|
||||
render: RootRenderFunction<HostNode, HostElement>
|
||||
createApp: () => App<HostElement>
|
||||
createApp: CreateAppFunction<HostElement>
|
||||
} {
|
||||
type HostVNode = VNode<HostNode, HostElement>
|
||||
type HostVNodeChildren = VNodeChildren<HostNode, HostElement>
|
||||
|
||||
Reference in New Issue
Block a user