react-native-modals
react-native-modals copied to clipboard
Close Popup
Hey guys,
I'd like to know how I can make the popup close when the user clicks a button.
Thanks,
@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>