react-native-popup-dialog-3
Version:
React Native Popup Dialog for IOS & Android.
36 lines (27 loc) • 668 B
JavaScript
// @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;