react-router-last-location
Version:
Provides access to the last location in react + react-router (v4.x) apps. Useful for handling internal routing. Easily prevent leaving your app by users.
9 lines (8 loc) • 363 B
TypeScript
import { RouteComponentProps } from 'react-router-dom';
declare type RRLocation = RouteComponentProps['location'] & {
[key: string]: any;
};
export declare const prevent: (location: RRLocation) => void;
export declare const hasBeenPrevented: (location: RRLocation) => boolean;
export declare const shouldPrevent: (location: RRLocation) => boolean;
export {};