Skip to content

Commit

Permalink
fix(useDirectiveComponent): cannot read properties of undefined (#19693)
Browse files Browse the repository at this point in the history
  • Loading branch information
kieuminhcanh committed Apr 30, 2024
1 parent a063f94 commit b9a588f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vuetify/src/composables/directiveComponent.ts
Expand Up @@ -25,15 +25,15 @@ 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
const provides = (vnode.ctx === binding.instance!.$
? 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,
Expand Down

0 comments on commit b9a588f

Please sign in to comment.