Search code examples
react-nativereact-native-flatlistscrollable

How can I make a Flatlist not scrollable in ReactNative


I would like to know can I make a flatlist not scrollable for a moment. For example: there is a boolean constant that whenever is true, you can scroll the flatlist but whenever is false, how can I make it so that it can not be scrolled?


Solution

  • The FlatList inherits props of ScrollView according to docs, so it should have scrollEnabled prop ScrollView props
    and try setting it up as:

    scrollEnabled={ false }
    

    in your FlatList props.