mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
* docs: reference docs * docs: guides * docs: top-level * docs: missed the route-trees * docs: fixing routing-concepts
1.1 KiB
1.1 KiB
| id | title |
|---|---|
| useLinkPropsHook | useLinkProps hook |
The useLinkProps hook that takes an object as its argument and returns a React.AnchorHTMLAttributes<HTMLAnchorElement> props object. These props can then be safely applied to an anchor element to create a link that can be used to navigate to the new location. This includes changes to the pathname, search params, hash, and location state.
useLinkProps options
type UseLinkPropsOptions = ActiveLinkOptions &
React.AnchorHTMLAttributes<HTMLAnchorElement>
ActiveLinkOptions- The
useLinkPropsoptions are used to build aLinkPropsobject. - It also extends the
React.AnchorHTMLAttributes<HTMLAnchorElement>type, so that any additional props that are passed to theuseLinkPropshook will be merged with theLinkPropsobject.
useLinkProps returns
- A
React.AnchorHTMLAttributes<HTMLAnchorElement>object that can be applied to an anchor element to create a link that can be used to navigate to the new location