I get this error when trying to use the swipeable component. All solutions on google are from previous versions and the fixes don’t apply. Not sure how to get around it.
Here is my code:
function ListItem({ title, subTitle, image, onPress, renderRightActions }) {
return (
<Swipeable renderRightActions={renderRightActions}>
<TouchableHighlight underlayColor={colors.light} onPress={onPress}>
<View style={styles.container}>
<Image style={styles.image} source={image} />
<View>
<AppText style={styles.title}>{title}</AppText>
<AppText style={styles.subTitle}>{subTitle}</AppText>
</View>
</View>
</TouchableHighlight>
</Swipeable>
);
}
function MessagesScreen(props) {
return (
<Screen>
<FlatList
data={messages}
keyExtractor={message => message.id.toString()}
renderItem={({ item }) => (
<ListItem
title={item.title}
subTitle={item.description}
image={item.image}
onPress={() => console.log('Message selected', item)}
renderRightActions={() => (
<View
style={{
backgroundColor: 'red',
width: 70,
}}
></View>
)}
/>
)}
ItemSeparatorComponent={ListItemSeparator}
/>
</Screen>
);
}