From 43f4bd3aaa80a3e308ed3c27717dbc83a10daff1 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 26 Oct 2019 16:32:27 -0400 Subject: [PATCH] chore: fix typing for withDirectives --- packages/runtime-core/src/directives.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/directives.ts b/packages/runtime-core/src/directives.ts index 052138a83e..9f77358706 100644 --- a/packages/runtime-core/src/directives.ts +++ b/packages/runtime-core/src/directives.ts @@ -104,11 +104,14 @@ export type DirectiveArguments = Array< | [Directive, any, string, DirectiveModifiers] > -export function withDirectives(vnode: VNode, directives: DirectiveArguments) { +export function withDirectives( + vnode: T, + directives: DirectiveArguments +): T { const internalInstance = currentRenderingInstance if (internalInstance === null) { __DEV__ && warn(`withDirectives can only be used inside render functions.`) - return + return vnode } const instance = internalInstance.renderProxy const props = vnode.props || (vnode.props = {}) -- 2.47.3