chore: fix typing for withDirectives
This commit is contained in:
parent
07ce2c5fa7
commit
43f4bd3aaa
@ -104,11 +104,14 @@ export type DirectiveArguments = Array<
|
|||||||
| [Directive, any, string, DirectiveModifiers]
|
| [Directive, any, string, DirectiveModifiers]
|
||||||
>
|
>
|
||||||
|
|
||||||
export function withDirectives(vnode: VNode, directives: DirectiveArguments) {
|
export function withDirectives<T extends VNode>(
|
||||||
|
vnode: T,
|
||||||
|
directives: DirectiveArguments
|
||||||
|
): T {
|
||||||
const internalInstance = currentRenderingInstance
|
const internalInstance = currentRenderingInstance
|
||||||
if (internalInstance === null) {
|
if (internalInstance === null) {
|
||||||
__DEV__ && warn(`withDirectives can only be used inside render functions.`)
|
__DEV__ && warn(`withDirectives can only be used inside render functions.`)
|
||||||
return
|
return vnode
|
||||||
}
|
}
|
||||||
const instance = internalInstance.renderProxy
|
const instance = internalInstance.renderProxy
|
||||||
const props = vnode.props || (vnode.props = {})
|
const props = vnode.props || (vnode.props = {})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user