Skip to content
Source
Sign inSign up
TanStack/router

docs(history): clarify blockerFn boolean contract #5414

OpenChristopher96u(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/5414/headopened

Showing 2 changed files with 10 additions and 3 deletions.

x
0 of 2 viewed, 2 left
1 addition and 1 deletiondocs/router/framework/react/api/router/useBlockerHook.mdModified
View file
@@ -57,7 +57,7 @@
​
- Optional
- Type: `BlockerFn`
-- The function that returns a `boolean` or `Promise<boolean>` indicating whether to allow navigation.
+- The function that returns a `boolean` or `Promise<boolean>` indicating whether the navigation should be blocked (`true` blocks, `false` allows).
​
### `options.condition` option (⚠️ deprecated)
​
9 additions and 2 deletionspackages/history/src/index.tsModified
View file
@@ -58,8 +58,13 @@
__TSR_index: number
​
-type ShouldAllowNavigation = any
+export type ShouldBlockNavigation = boolean
​
+/**
+ * @deprecated Use `ShouldBlockNavigation`. Returning `true` blocks navigation.
+ */
+export type ShouldAllowNavigation = ShouldBlockNavigation