NavigationBlockerAdapter
Defined in: packages/react/src/config/useFrameworkComponents.ts:39
Framework adapter capability for intercepting navigation away from a
dirty edit view (decisions 1–2). @vexcms/react never imports a router —
useUnsavedChangesGuard calls useBlocker unconditionally and the
adapter decides how to intercept in-app link clicks and back/forward for
its framework (unload is NOT this adapter’s job — useUnsavedChangesGuard
registers beforeunload itself). @vexcms/next is the only
implementation shipped in 0.1.0 (Step 8); a TanStack Start adapter would
implement the same contract without touching @vexcms/react.
Methods
Section titled “Methods”useBlocker()
Section titled “useBlocker()”useBlocker(
props):void
Defined in: packages/react/src/config/useFrameworkComponents.ts:51
Registers interception for the lifetime of the calling component,
re-registering whenever when changes. A Rules-of-Hooks-safe hook:
called every render regardless of when’s value.
Parameters
Section titled “Parameters”Blocker props.
onBlock
Section titled “onBlock”(proceed) => void
Called with a proceed callback instead of
letting a blocked navigation through; calling proceed() lets that
ONE navigation complete (a Leave click, or a released guard).
boolean
Whether navigation should currently be intercepted.
Returns
Section titled “Returns”void