Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6291

Asyncstorage remove item, it is not working

$
0
0
const handleDeleteProduct = product => {    Alert.alert('Delete Product',      `Are you sure you want to delete ${product.id}?`,      [        {          text: 'Cancel',          style: 'cancel',        },        {          text: 'Delete',          style: 'destructive',          onPress: async (key = product.item) => {            try {              await AsyncStorage.removeItem(key);              // RNRestart.Restart();            } catch (e) {              console.error(e);            }          },        },      ],    );  };

*Please help me, this removeItem does not work, eventhough i follow the documentation in https://react-native-async-storage.github.io/async-storage/docs/api

I try to delete an Item using onLong event in TouchableWithoutFeedback element in a reactnative element, I enclose the TouchableWithoutFeedback in flatlist.


Viewing all articles
Browse latest Browse all 6291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>