mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at rm-open 44 lines 1.3 kB view raw
1import {useEffect, useRef} from 'react' 2import {useAnimatedScrollHandler as useAnimatedScrollHandler_BUGGY} from 'react-native-reanimated' 3 4export const useAnimatedScrollHandler: typeof useAnimatedScrollHandler_BUGGY = ( 5 config, 6 deps, 7) => { 8 const ref = useRef(config) 9 useEffect(() => { 10 ref.current = config 11 }) 12 return useAnimatedScrollHandler_BUGGY( 13 { 14 onBeginDrag(e, ctx) { 15 if (typeof ref.current !== 'function' && ref.current.onBeginDrag) { 16 ref.current.onBeginDrag(e, ctx) 17 } 18 }, 19 onEndDrag(e, ctx) { 20 if (typeof ref.current !== 'function' && ref.current.onEndDrag) { 21 ref.current.onEndDrag(e, ctx) 22 } 23 }, 24 onMomentumBegin(e, ctx) { 25 if (typeof ref.current !== 'function' && ref.current.onMomentumBegin) { 26 ref.current.onMomentumBegin(e, ctx) 27 } 28 }, 29 onMomentumEnd(e, ctx) { 30 if (typeof ref.current !== 'function' && ref.current.onMomentumEnd) { 31 ref.current.onMomentumEnd(e, ctx) 32 } 33 }, 34 onScroll(e, ctx) { 35 if (typeof ref.current === 'function') { 36 ref.current(e, ctx) 37 } else if (ref.current.onScroll) { 38 ref.current.onScroll(e, ctx) 39 } 40 }, 41 }, 42 deps, 43 ) 44}