-
-
Notifications
You must be signed in to change notification settings - Fork 439
Open
Description
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 anonScroll
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
/>
junchenjun
Metadata
Metadata
Assignees
Labels
No labels