Skip to content

Expose Native onScroll Prop for Reanimated Support in DraggableFlatList (currently passed but ignored) #597

@AvielCo

Description

@AvielCo

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
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions