You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to use useTemplateRef on a component instance but I am getting this type error:
app.vue:18:85 - error TS2339: Property 'onInputClick' does not exist on type '{ $props: DatePickerProps & VNodeProps & AllowedComponentProps & ComponentCustomProps; $slots: DatePickerSlots; $emit: ((e: "update:modelValue", value: Date | ... 3 more ... | undefined) => void) & ... 11 more ... & ((e: "keydown", event: Event) => void); }'.
18 console.log('datePickerEl.value.onInputClick', toRaw(datePickerEl.value.onInputClick)) // ƒ onInputClick()
What is interesting is that the function onInputClick actually does exist on the Date Picker and it works too. But my IDE and type checker throws an error. I also tried to use ComponentPublicInstance but that didn't work either.
Vue version
3.5.13
Link to minimal reproduction
https://stackblitz.com/~/github.com/martinszeltins/template-ref-test
Steps to reproduce
I wanted to use
useTemplateRef
on a component instance but I am getting this type error:What is interesting is that the function
onInputClick
actually does exist on the Date Picker and it works too. But my IDE and type checker throws an error. I also tried to useComponentPublicInstance
but that didn't work either.app.vue
What is expected?
It should properly recognize the type that
datePickerEl
is a component instance ofDatePicker
which has functions that can be called.What is actually happening?
Getting type error
System Info
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: