react-native-modals icon indicating copy to clipboard operation
react-native-modals copied to clipboard

Close Popup

Open mmatheusmmiguel opened this issue 9 years ago • 1 comments

Hey guys,

I'd like to know how I can make the popup close when the user clicks a button.

Thanks,

mmatheusmmiguel avatar May 22 '17 01:05 mmatheusmmiguel

@mmatheusmmiguel I think you can do something like this:


<View style={styles.container}>
  <Button
    text="Close"
    onPress={() => {
      this.popupDialog.dismiss();
    }}
  />
  <PopupDialog
    ref={(popupDialog) => { this.popupDialog = popupDialog; }}
  >
    <View>
      <Text>Hello</Text>
    </View>
  </PopupDialog>
</View>

jacklam718 avatar May 25 '17 16:05 jacklam718