5
rated 0 times
[
10]
[
5]
/ answers: 1 / hits: 33823
/ 6 Years ago, wed, december 19, 2018, 12:00:00
I have a data which is rendered as view and came across a issue on how to remove that particular index which is swiped
I have used FlatList as follows
render() {
this.leftOpenValue = Dimensions.get('window').width;
this.rightOpenValue = -Dimensions.get('window').width;
return (
<FlatList
data = {data}
keyExtractor = {data => data.id}
renderItem={ ({item}) => (
<View style={styles.container}>
<SwipeView
disableSwipeToRight = {false}
renderVisibleContent={() =>
<View>
<Text style={styles.text}> {item.title} </Text> // This repeats 9 times (9 Index)
</View>
}
renderRightView={() => (
<View style={{flex:1, justifyContent: 'flex-end', alignItems: 'center', backgroundColor: 'red'}}>
</View>
)}
leftOpenValue = {this.leftOpenValue}
rightOpenValue = {this.rightOpenValue}
onSwipedLeft={() => alert(deleted)}
swipeDuration = {300}
swipeToOpenPercent = {40}
disableSwipeToRight = {true}
/>
</View>
)}
/>
);
I have used Swipeview to swipe (react-native-swipeview) and delete the index in flatlist
I have an issue on how to remove an item from flatList
More From » react-native