I made an app on react native using expo and I want to implement alert.prompt from ios on android devices. I installed react-native-prompt but I can't use on expo it is existing other solutions for that? thank you!
0
votes
3 Answers
2
votes
Try this library, This is also compatible with expo because it is only a js API.You can create Text input, Title, Sub-title and button from it inside your prompt.
https://www.npmjs.com/package/react-native-dialog
I have also created a snack for you, have a look.
0
votes
Alert.alert(
'Alert Title',
'My Alert Msg',
[
{ text: 'Ask me later', onPress: () => console.log('Ask me later pressed') },
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel',
},
{ text: 'OK', onPress: () => console.log('OK Pressed') },
],
{ cancelable: false }
);
For more information visit https://docs.expo.io/versions/latest/react-native/alert/