refactor(types): widen Component type to include consutructor types
returned from `defineComponent` ref: https://github.com/vuejs/vue-router-next/pull/421 also close #1880 Previous `Component` type is now exported as `ConcreteComponent`. This introduces a minor breaking change when calling `h(comp, { ... })` will now fail if `comp` is a of generic `Component` type, since it does not specify what props it expects.
This commit is contained in:
@@ -15,8 +15,9 @@ import {
|
||||
import {
|
||||
ComponentInternalInstance,
|
||||
Data,
|
||||
Component,
|
||||
ClassComponent
|
||||
ConcreteComponent,
|
||||
ClassComponent,
|
||||
Component
|
||||
} from './component'
|
||||
import { RawSlots } from './componentSlots'
|
||||
import { isProxy, Ref, toRaw } from '@vue/reactivity'
|
||||
@@ -244,7 +245,7 @@ export function isSameVNodeType(n1: VNode, n2: VNode): boolean {
|
||||
if (
|
||||
__DEV__ &&
|
||||
n2.shapeFlag & ShapeFlags.COMPONENT &&
|
||||
hmrDirtyComponents.has(n2.type as Component)
|
||||
hmrDirtyComponents.has(n2.type as ConcreteComponent)
|
||||
) {
|
||||
// HMR only: if the component has been hot-updated, force a reload.
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user