Logically disable Drag on react-native-draggable-flatlist

1.3k Views Asked by At

I'm trying to disable the drag feature based on some props change, not sure how to disable/enable it on 'react-native-draggable-flatlist', please find below the code

import DraggableFlatList from 'react-native-draggable-flatlist'
    <DraggableFlatList
      scrollPercent={5}
      data={this.state.data}
      renderItem={this.renderItem}
      keyExtractor={(item: any) => `draggable-item-${item}`}
      onMoveEnd={({ data }: any) => {
        this.setState({ data })
      }}
    />
1

There are 1 best solutions below

0
On BEST ANSWER

As per my requirement, I have totally disabled the parent component and it worked, but still not sure if there are any ways to disable it by passing a particular prop