File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
packages/react-router/src Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,18 @@ export type UseMatchRouteOptions<
123123 MaskOptions < TRouter , TMaskFrom , TMaskTo > &
124124 MatchRouteOptions
125125
126+ /**
127+ * Create a matcher function for testing locations against route definitions.
128+ *
129+ * The returned function accepts standard navigation options (`to`, `params`,
130+ * `search`, etc.) and returns either `false` (no match) or the matched params
131+ * object when the route matches the current or pending location.
132+ *
133+ * Useful for conditional rendering and active UI states.
134+ *
135+ * @returns A `matchRoute(options)` function that returns `false` or params.
136+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchRouteHook
137+ */
126138export function useMatchRoute < TRouter extends AnyRouter = RegisteredRouter > ( ) {
127139 const router = useRouter ( )
128140
@@ -231,6 +243,15 @@ export function useMatches<
231243 } as any ) as UseMatchesResult < TRouter , TSelected >
232244}
233245
246+ /**
247+ * Read the full array of active route matches or select a derived subset.
248+ *
249+ * Useful for debugging, breadcrumbs, or aggregating metadata across matches.
250+ *
251+ * @returns The array of matches (or the selected value).
252+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchesHook
253+ */
254+
234255/**
235256 * Read the full array of active route matches or select a derived subset.
236257 *
Original file line number Diff line number Diff line change @@ -8,6 +8,20 @@ import type {
88 UseNavigateResult ,
99} from '@tanstack/router-core'
1010
11+ /**
12+ * Imperative navigation hook.
13+ *
14+ * Returns a stable `navigate(options)` function to change the current location
15+ * programmatically. Prefer the `Link` component for user-initiated navigation,
16+ * and use this hook from effects, callbacks, or handlers where imperative
17+ * navigation is required.
18+ *
19+ * Options:
20+ * - `from`: Optional route base used to resolve relative `to` paths.
21+ *
22+ * @returns A function that accepts `NavigateOptions`.
23+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useNavigateHook
24+ */
1125export function useNavigate <
1226 TRouter extends AnyRouter = RegisteredRouter ,
1327 TDefaultFrom extends string = string ,
You can’t perform that action at this time.
0 commit comments