You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 69e5769
Browse filesBrowse the repository at this point in the historyBrowse files
Active and pending state is styled with CSS — one vocabulary for every kind of link:
520
+
Active and pending state is styled with CSS — one vocabulary for every kind of link. `aria-current` and `data-active` are automatic; `data-pending` is opt-in:
With it, `data-pending` agrees with `useLinkState().pending` at every moment. Back/forward traversals don't mark links pending.
542
+
It marks the links whose path covers the in-flight destination of a link click or `navigate()` call — by the same path rule as `data-active` — until that navigation lands. Back/forward traversals don't mark links pending. `data-pending` agrees with `useLinkState().pending` at every moment; the hook works with or without the plugin.
543
543
544
544
One rule decides both, for anchors and `useLinkState` alike:
545
545
@@ -861,7 +861,7 @@ See [Typed Search Params](#typed-search-params). Reads are proxied — access pr
861
861
862
862
### useIsRouting
863
863
864
-
A signal indicating whether the router is processing a navigation — useful for pending UI while the next route and its data settle:
864
+
A signal indicating whether the router is processing a navigation — useful for pending UI while the next route and its data settle. It's the way to read routing state: `RouterContext` doesn't carry `isRouting` or `pendingTarget`.
865
865
866
866
```tsx
867
867
const isRouting =useIsRouting();
@@ -926,7 +926,7 @@ Reactive `active`/`current`/`pending` state for [custom link components](#links)
926
926
927
927
-`current()` — same path and same query as the location, ignoring parameter order and the hash (what `aria-current="page"` reflects)
928
928
-`active()` — the location's path is the link's path or lives under it, query ignored (`data-active`); a root link (`/`, which resolves to the router's `base`) is exact-only
929
-
-`pending()` — the link's path is the target of an in-flight navigation, back/forward excluded (`data-pending`, with [`pendingLinks`](#links))
929
+
-`pending()` — the link's path is the target of an in-flight navigation, back/forward excluded (`data-pending`). Works without the [`pendingLinks`](#links) plugin, which only adds the attribute to plain anchors
930
930
931
931
Pass `{ end: true }` to make `active` (and `pending`) exact-path for any link.
-`end` → style exact matches with `[aria-current="page"]` (which also compares the query) instead of `[data-active]`; the root path already only matches exactly
1056
+
- Pending link styling → `[data-pending]`, opt-in with `createRouter({ routes, links: pendingLinks })`
0 commit comments