UNPKG

react-native-popup-dialog-3

Version:
36 lines (27 loc) 668 B
// @flow import React, { Component } from 'react'; import Dialog from './components/Dialog'; import type { PopupDialogType } from './type'; class PopupDialog extends Component { props: PopupDialogType; dialog: Object show = (onShown: ?Function) => { this.dialog.show(onShown); } dismiss = (onDismissed: ?Function) => { this.dialog.dismiss(onDismissed); } render() { const { children, dialogTitle, ...restProps } = this.props; return ( <Dialog ref={(dialog) => { this.dialog = dialog; }} {...restProps} > {dialogTitle} {children} </Dialog> ); } } export default PopupDialog;