hasUnsavedForms
hasUnsavedForms():
boolean
Defined in: navigationGuard.ts:25
Whether a form guarded by useFormNavigationGuard has unsaved changes
Returns
Section titled “Returns”boolean
Remarks
Section titled “Remarks”Hand it to the router as a function rather than calling it during render, so that the router asks at the moment of
navigation: a navigation right after the form resets, as from a didSubmit handler, then goes through.
It reads observables, so an observer that calls it re-renders when the answer changes.
Example
Section titled “Example”// React Routerconst blocker = useBlocker(hasUnsavedForms);