Skip to content

Suggestion: Use FlatList from react-native-gesture-handler for better performance & gesture coordination #512

@francoangulo

Description

@francoangulo

Description

Hi! 👋
First of all, thank you for maintaining this library — it’s been extremely useful.

While working with react-native-autocomplete-input, I noticed that the component currently imports:

import { FlatList } from 'react-native';

However, in many React Native projects (especially those using gesture-heavy components, React Navigation, or bottom sheets), the default React Native FlatList has issues coordinating gestures — particularly inside scrollable or nested gesture surfaces.

To solve this, the community-recommended version is the FlatList exported by react-native-gesture-handler, which provides:

  • Better gesture coordination inside complex UI layouts
  • More reliable scrolling inside nested gesture contexts
  • Reduced scroll conflicts when combined with bottom sheets, swipes, or navigation gestures
  • Improved compatibility with libraries that rely on RNGH

Switching to:

import { FlatList } from 'react-native-gesture-handler';

provides a more robust and modern scroll/gesture handling experience, especially inside autocomplete dropdowns that appear over scrollable containers.


Suggested Change

Replace the import in the relevant component file:

-import { FlatList } from 'react-native';
+import { FlatList } from 'react-native-gesture-handler';

Optional: Add react-native-gesture-handler as a peer dependency if desired:

"peerDependencies": {
  "react-native-gesture-handler": ">=2.0.0"
}

Impact

This change would help prevent common gesture conflicts and scrolling issues reported across many RN apps, especially when using:

  • BottomSheet libraries
  • React Navigation (gestures enabled)
  • Swipeable/Draggable lists
  • Nested scroll views

It would also make the library more compatible with gesture-driven UIs in 2025+ RN projects.


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions