You can use **@blazejkustra/react-native-alert** as a drop-in replacement for `Alert` that supports prompts on Android too. It provides:
* `Alert.prompt(...)` on all platforms (iOS, Android, Web)
* Exactly the same API as React Native’s built-in `Alert`
* No extra setup needed on Android to get prompt dialogs working :)
So in your code you’d just:
```js
import Alert from '@blazejkustra/react-native-alert';
Alert.prompt(
'Add New Item',
null,
[
{ text: 'Cancel', style: 'cancel' },
{ text: 'Add', onPress: text => this.itemsRef.push({ title: text }) },
],
'plain-text'
);
```
You can use **@blazejkustra/react-native-alert** as a drop-in replacement for `Alert` / `AlertIOS.prompt` that supports prompts on Android too. It provides:
* `Alert.prompt(...)` on all platforms (iOS, Android, Web)
* Exactly the same API as React Native’s built-in `Alert`
* No extra setup needed on Android to get prompt dialogs working :)
So in your code you’d just:
```js
import Alert from '@blazejkustra/react-native-alert';
Alert.prompt(
'Add New Item',
null,
[
{ text: 'Cancel', style: 'cancel' },
{ text: 'Add', onPress: text => this.itemsRef.push({ title: text }) },
],
'plain-text'
);
```