Skip to content

Commit

Permalink
complete href in the link prop
Browse files Browse the repository at this point in the history
  • Loading branch information
jprosevear committed Jan 23, 2025
1 parent 696a499 commit eff03db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/components/link/src/use-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export function useLink(originalProps: UseLinkProps) {
as,
children,
anchorIcon,
href,
isExternal = false,
showAnchorIcon = false,
autoFocus = false,
Expand All @@ -73,6 +74,7 @@ export function useLink(originalProps: UseLinkProps) {
const {linkProps} = useAriaLink(
{
...otherProps,
href,
onPress,
onPressStart,
onPressEnd,
Expand Down Expand Up @@ -110,6 +112,8 @@ export function useLink(originalProps: UseLinkProps) {
"data-focus": dataAttr(isFocused),
"data-disabled": dataAttr(originalProps.isDisabled),
"data-focus-visible": dataAttr(isFocusVisible),
// The `href` prop may be routerized by useAriaLink, so we may merge over top of it
href,
...mergeProps(focusProps, linkProps, otherProps),
};
}, [classNames, isFocused, isFocusVisible, focusProps, linkProps, otherProps]);
Expand Down

0 comments on commit eff03db

Please sign in to comment.