diff --git a/packages/runtime-core/src/directives.ts b/packages/runtime-core/src/directives.ts index 052138a8..9f773587 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 = {})