ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
15 lines • 604 B
TypeScript
import type { RouterBlocker, RouterBlockerFunction } from "./RouterProvider.js";
/**
* Hook to block navigation based on a condition.
* This is a router-agnostic wrapper that uses the configured router provider.
* Used by useWarnWhenUnsavedChanges to prevent losing form data.
*
* @example
* const blocker = useBlocker(shouldBlock);
* if (blocker.state === 'blocked') {
* // Show confirmation dialog
* blocker.proceed(); // or blocker.reset();
* }
*/
export declare const useBlocker: (shouldBlock: RouterBlockerFunction | boolean) => RouterBlocker;
//# sourceMappingURL=useBlocker.d.ts.map