UNPKG

react-router-navigation-confirm

Version:

A collection of components to display a custom confirmation dialog on navigation. More flexible solution to prevent than default react-router 'Prompt'

26 lines (25 loc) 930 B
import * as React from 'react'; import { NavigationConfirmChildData, WhenPropType } from '../types'; import './NavigationConfirmModal.css'; interface IProps { children?: React.ReactNode; confirmText?: string; cancelText?: string; modalClassName?: string; backdropClassName?: string; contentClassName?: string; bodyClassName?: string; footerClassName?: string; buttonClassName?: string; buttonConfirmClassName?: string; onConfirm?: () => void; onCancel?: () => void; when?: WhenPropType; } declare class NavigationConfirmModal extends React.Component<IProps, {}> { static defaultProps: IProps; decorate: (fn: () => void, hook?: (() => void) | undefined) => () => void; renderModal: ({ onConfirm, onCancel }: NavigationConfirmChildData) => React.ReactElement<{}>; render(): JSX.Element; } export { NavigationConfirmModal, IProps as NavigationConfirmModalProps, };