Skip to content

Commit 331dafa

Browse files
hirbodgorhom
andauthored
fix:(web) fixed scroll handler hook to pass provided onScroll (#1993)(by @hirbod)
* fix:(web) useScrollHandler.web.ts * chore: updated the onScroll type --------- Co-authored-by: gorhom <gorhom.dev@gmail.com>
1 parent b7277d3 commit 331dafa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/hooks/useScrollHandler.web.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import { type TouchEvent, useEffect, useRef } from 'react';
22
import { findNodeHandle } from 'react-native';
33
import { useSharedValue } from 'react-native-reanimated';
44
import { ANIMATION_STATE, SCROLLABLE_STATE } from '../constants';
5-
import type { Scrollable } from '../types';
5+
import type { Scrollable, ScrollableEvent } from '../types';
66
import { useBottomSheetInternal } from './useBottomSheetInternal';
77

88
export type ScrollEventContextType = {
99
initialContentOffsetY: number;
1010
shouldLockInitialPosition: boolean;
1111
};
1212

13-
export const useScrollHandler = () => {
13+
export const useScrollHandler = (_: never, onScroll?: ScrollableEvent) => {
1414
//#region refs
1515
const scrollableRef = useRef<Scrollable>(null);
1616
//#endregion
@@ -168,7 +168,7 @@ export const useScrollHandler = () => {
168168
//#endregion
169169

170170
return {
171-
scrollHandler: undefined,
171+
scrollHandler: onScroll,
172172
scrollableRef,
173173
scrollableContentOffsetY,
174174
};

0 commit comments

Comments
 (0)