1 parent ebc097e commit 2ff2f38Copy full SHA for 2ff2f38
1 file changed
src/useOnInView.tsx
@@ -47,7 +47,7 @@ export const useOnInView = <TElement extends Element>(
47
triggerOnce,
48
skip,
49
}: IntersectionEffectOptions = {},
50
-) => {
+): ((element: TElement | undefined | null) => (() => void) | undefined) => {
51
return useIntersectionObserverRef<TElement>(
52
(inView, entry, previousInView) => {
53
// Ignore the very first `false` notification so consumers only hear about actual state changes.
@@ -67,5 +67,5 @@ export const useOnInView = <TElement extends Element>(
67
68
69
},
70
- ) as (element: TElement | undefined | null) => (() => void) | undefined;
+ );
71
};
0 commit comments