Skip to content

Commit 2ff2f38

Browse files
committed
refactor: declare useOnInView return type
1 parent ebc097e commit 2ff2f38

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/useOnInView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const useOnInView = <TElement extends Element>(
4747
triggerOnce,
4848
skip,
4949
}: IntersectionEffectOptions = {},
50-
) => {
50+
): ((element: TElement | undefined | null) => (() => void) | undefined) => {
5151
return useIntersectionObserverRef<TElement>(
5252
(inView, entry, previousInView) => {
5353
// Ignore the very first `false` notification so consumers only hear about actual state changes.
@@ -67,5 +67,5 @@ export const useOnInView = <TElement extends Element>(
6767
triggerOnce,
6868
skip,
6969
},
70-
) as (element: TElement | undefined | null) => (() => void) | undefined;
70+
);
7171
};

0 commit comments

Comments
 (0)