I wanna add an alert box in my react native app on delete action I need to confirm if the user clicks on Ok then the record will be deleted if the user clicks on cancel button then alert should be close or dismiss. how may I do it.?
Alert.alert(
'Alert Title',
'My Alert Msg',
[
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
},
{
text: 'OK',
onPress: () => console.log('OK Pressed')
},
],
{cancelable: false},
);
if you not given any function call on cancel button it will work as dismiss for alert