I am attempting to enable swiping on my list items in my React Native app, using SwipeListView from the react-native-swipe-list-view
package.
<View>
<SwipeListView
data={listData.filter((item) => typeof item['approved'] === "undefined")}
renderItem={renderSwipeItem}
keyExtractor={item => item.id.toString()}
onRowDidOpen={(rowKey, rowMap) => {}}
disableRightSwipe={false} // Disable right swipe to prevent accidental dismiss
disableLeftSwipe={false} // Disable left swipe to prevent accidental dismiss
renderHiddenItem={() => <></>} // No need for hidden buttons
rightOpenValue={-75} // Set the value to trigger dismiss
leftOpenValue={75} // Set the value to trigger dismiss
onSwipeValueChange={handleSwipeValueChange}
/>
</View>
I was able to set up the swiping of list items just fine. However, after swiping the first list item, I cannot scroll down through the list. I tried wrapping the above code in <ScrollView>
tags from the React Native library and was able to fix the scrolling issue. However, I get the following error:
ERROR: VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead.
How can I go about using SwipeListView and still be able to scroll? Or is there another VirtualizedList-backed container I should use instead of react-native-swipe-list-view
?