Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(useDirectiveComponent): Cannot read properties of undefined (reading 'text') #19693

Merged
merged 1 commit into from Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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