BUG | useIntersectionObserver
| useTemplateRef
of array type cannot be passed as argument
#4712
Open
7 tasks done
Labels
bug
Something isn't working
Describe the bug
Given
where
$events
is a ref with array of elements andref="$events"
bound to element which hasv-for
it will mark template ref's value asReadonly<ShallowRef<HTMLDivElement[] | null>>
which is incompatible withMaybeComputedElementRef | MaybeRefOrGetter<MaybeElement[]> | MaybeComputedElementRef[]
.Of course it can be mitigated by using
computed(() => $events.value ?? [])
and it will work fine, but it would propably be possible to improve the input types for the composable itself (did not have time yet to look closer into it).For reproduction type
vue-tsc -p tsconfig.app.json
in terminal.Reproduction
https://stackblitz.com/edit/vitejs-vite-cadjhx57?file=src%2Fviews%2FAbout.vue,src%2Fcomponents%2FCounter.vue,src%2Fcomponents%2FHeader.vue,src%2Fviews%2FHome.vue,src%2FApp.vue
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: