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'

21 lines (20 loc) 995 B
import * as React from 'react'; import { History } from 'history'; import { RouteComponentProps } from 'react-router-dom'; import { HistoryService } from '../services'; declare const HistoryListenerContext: React.Context<HistoryService | undefined>; interface IProps extends RouteComponentProps { children?: React.ReactNode; } declare class HistoryListener extends React.Component<IProps, {}> { historyService: HistoryService; unlisten: () => void; componentDidMount(): void; componentWillUnmount(): void; listen: History.LocationListener; render(): JSX.Element; } declare const HistoryListenerWithRouter: React.ComponentClass<Pick<IProps, "children"> & { wrappedComponentRef?: ((instance: HistoryListener | null) => void) | React.RefObject<HistoryListener> | null | undefined; }, any> & import("react-router").WithRouterStatics<typeof HistoryListener>; export { HistoryListener, HistoryListenerWithRouter, HistoryListenerContext, IProps as HistoryStoreProps, };