Skip to content

Commit fe9e227

Browse files
committed
types: adjust resolveDynamicComponent return type
1 parent d5ab70b commit fe9e227

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/runtime-core/src/helpers/resolveAssets.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { currentInstance, Component, FunctionalComponent } from '../component'
33
import { Directive } from '../directives'
44
import { camelize, capitalize, isString } from '@vue/shared'
55
import { warn } from '../warning'
6+
import { VNodeTypes } from '../vnode'
67

78
const COMPONENTS = 'components'
89
const DIRECTIVES = 'directives'
@@ -19,14 +20,12 @@ export const NULL_DYNAMIC_COMPONENT = Symbol()
1920
/**
2021
* @private
2122
*/
22-
export function resolveDynamicComponent(
23-
component: unknown
24-
): Component | string | typeof NULL_DYNAMIC_COMPONENT {
23+
export function resolveDynamicComponent(component: unknown): VNodeTypes {
2524
if (isString(component)) {
2625
return resolveAsset(COMPONENTS, component, false) || component
2726
} else {
2827
// invalid types will fallthrough to createVNode and raise warning
29-
return (component as any) || NULL_DYNAMIC_COMPONENT
28+
return (component || NULL_DYNAMIC_COMPONENT) as any
3029
}
3130
}
3231

0 commit comments

Comments
 (0)