Feature Request: Expose Native onScroll Prop for Reanimated Support in DraggableFlatList
Background:
Currently, DraggableFlatList only exposes an onScrollOffsetChange callback, which provides the scroll offset via the JS thread. This limits animation smoothness, especially when using Reanimated, as updates are not native-thread-driven and can result in choppy UI transitions.
Request:
Please add support for forwarding the native onScroll prop (and ideally, scrollEventThrottle) to the underlying scrollable (Animated.FlatList). This will allow consumers to use Reanimated’s useAnimatedScrollHandler for smooth, native-thread-driven animations.
Acceptance Criteria:
DraggableFlatList accepts an onScroll prop and passes it to the underlying scrollable.
- The component continues to support
onScrollOffsetChange for backward compatibility.
- Documentation is updated to reflect the new prop and its intended usage with Reanimated.
Example Usage:
const scrollOffsetY = useSharedValue(0);
const onScroll = useAnimatedScrollHandler({
onScroll: (event) => {
scrollOffsetY.value = event.contentOffset.y;
},
});
<DraggableFlatList
onScroll={onScroll}
scrollEventThrottle={16}
// ...other props
/>
Feature Request: Expose Native onScroll Prop for Reanimated Support in DraggableFlatList
Background:
Currently,
DraggableFlatListonly exposes anonScrollOffsetChangecallback, which provides the scroll offset via the JS thread. This limits animation smoothness, especially when using Reanimated, as updates are not native-thread-driven and can result in choppy UI transitions.Request:
Please add support for forwarding the native
onScrollprop (and ideally,scrollEventThrottle) to the underlying scrollable (Animated.FlatList). This will allow consumers to use Reanimated’suseAnimatedScrollHandlerfor smooth, native-thread-driven animations.Acceptance Criteria:
DraggableFlatListaccepts anonScrollprop and passes it to the underlying scrollable.onScrollOffsetChangefor backward compatibility.Example Usage: