From b9a588fe8a634dcd80546edf4124873e497cf494 Mon Sep 17 00:00:00 2001 From: Ken Kieu Date: Tue, 30 Apr 2024 06:46:07 -0700 Subject: [PATCH] fix(useDirectiveComponent): cannot read properties of undefined (#19693) --- packages/vuetify/src/composables/directiveComponent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vuetify/src/composables/directiveComponent.ts b/packages/vuetify/src/composables/directiveComponent.ts index 11d1c8af9bc..1335e08a39a 100644 --- a/packages/vuetify/src/composables/directiveComponent.ts +++ b/packages/vuetify/src/composables/directiveComponent.ts @@ -25,7 +25,7 @@ export const useDirectiveComponent = ( const { value } = binding // Get the children from the props or directive value, or the element's children - const children = props.text || value.text || el.innerHTML + const children = props?.text || value?.text || el.innerHTML // If vnode.ctx is the same as the instance, then we're bound to a plain element // and need to find the nearest parent component instance to inherit provides from @@ -33,7 +33,7 @@ export const useDirectiveComponent = ( ? findComponentParent(vnode, binding.instance!.$)?.provides : vnode.ctx?.provides) ?? binding.instance!.$.provides - const node = h(concreteComponent, mergeProps(props, value), children) + const node = h(concreteComponent, mergeProps(props, value), { default: () => children }) node.appContext = Object.assign( Object.create(null), (binding.instance as ComponentPublicInstance).$.appContext,