react-native-prompt-android
react-native-prompt-android copied to clipboard
Trigger the prompt with an onpress
I need to ask user for input onPress. Obviously this code doesn't work but I want something like that:
const Newact = (props) => {
return(
<View>
<View style={styles.button} >
<TouchableOpacity style={styles.center} onPress= {prompt = ('','',
[
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'OK', onPress: password => console.log('OK Pressed, password: ' + password)},
],
{
type: 'secure-text',
cancelable: false,
defaultValue: '',
placeholder: 'placeholder'
}
)}>
<Text style={styles.plusSign}>+</Text>
</TouchableOpacity>
</View>
</View>
);
}