feat(hmr): root instance reload

This commit is contained in:
Evan You
2019-12-22 12:25:04 -05:00
parent c3e1c812e3
commit eda495efd8
4 changed files with 27 additions and 10 deletions

View File

@@ -1727,12 +1727,12 @@ export function createRenderer<
}
}
const render: RootRenderFunction<
HostNode,
HostElement & {
_vnode: HostVNode | null
}
> = (vnode, container) => {
type HostRootElement = HostElement & { _vnode: HostVNode | null }
const render: RootRenderFunction<HostNode, HostElement> = (
vnode,
container: HostRootElement
) => {
if (vnode == null) {
if (container._vnode) {
unmount(container._vnode, null, null, true)