UNPKG

envoc-form

Version:

Envoc form components

18 lines (17 loc) 800 B
import type { History } from 'history'; import { Navigator as BaseNavigator } from 'react-router-dom'; interface Navigator extends BaseNavigator { block?: History['block']; } export interface FormBasedPreventNavigationProps { promptMessage?: string; preventNavigate: boolean; navigator: Navigator; } /** Only use this if the project uses `<BrowserRouter/>` or any router that does not support the new * [react-router Data API](https://reactrouter.com/en/main/routers/picking-a-router#using-v64-data-apis) * * Legacy function to prevent the user from navigating away from a form if there are any changes. */ export default function LegacyFormBasedPreventNavigation({ promptMessage, preventNavigate, navigator, }: FormBasedPreventNavigationProps): null; export {};