Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger the prompt with an onpress #57

Open
OmarOdaini opened this issue Jul 5, 2020 · 0 comments
Open

Trigger the prompt with an onpress #57

OmarOdaini opened this issue Jul 5, 2020 · 0 comments

Comments

@OmarOdaini
Copy link

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>
    );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant