From 2ac2a975e05b533d1c037150d88b727fb44d7cc2 Mon Sep 17 00:00:00 2001 From: Michael Brevard Date: Sun, 24 Mar 2024 23:08:51 +0200 Subject: [PATCH] fix: proper intersection callback type --- packages/nuxt/src/components/runtime/client-io-component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nuxt/src/components/runtime/client-io-component.ts b/packages/nuxt/src/components/runtime/client-io-component.ts index 081e2d82a7..d7b1e7273b 100644 --- a/packages/nuxt/src/components/runtime/client-io-component.ts +++ b/packages/nuxt/src/components/runtime/client-io-component.ts @@ -2,10 +2,10 @@ import { defineComponent, onMounted, onUnmounted, ref } from 'vue' export default defineComponent({ setup (props, { emit }) { - const intersectionTarget = ref(null) + const intersectionTarget: Ref = ref(null) let observer: IntersectionObserver | null = null - const intersectionCallback = (entries) => { + const intersectionCallback: IntersectionObserverCallback = (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { emit('intersect') @@ -16,7 +16,7 @@ export default defineComponent({ onMounted(() => { observer = new IntersectionObserver(intersectionCallback) - observer.observe(intersectionTarget.value) + observer.observe(intersectionTarget.value as Element) }) onUnmounted(() => {