MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Link

Function Link

starters/hooks/src/Link.tsx:14–34  ·  view source on GitHub ↗
(props: LinkProps)

Source from the content-addressed store, hash-verified

12}
13
14export function Link(props: LinkProps) {
15 let ref = useRef<HTMLAnchorElement>(null);
16 let {linkProps, isPressed} = useLink(props, ref);
17 let {hoverProps, isHovered} = useHover(props);
18 let {focusProps, isFocusVisible} = useFocusRing();
19
20 return (
21 <a
22 {...mergeProps(linkProps, hoverProps, focusProps)}
23 ref={ref}
24 href={props.href}
25 target={props.target}
26 className="react-aria-Link"
27 data-hovered={isHovered || undefined}
28 data-pressed={isPressed || undefined}
29 data-focus-visible={isFocusVisible || undefined}
30 data-disabled={props.isDisabled || undefined}>
31 {props.children}
32 </a>
33 );
34}

Callers

nothing calls this directly

Calls 4

useLinkFunction · 0.90
useHoverFunction · 0.90
useFocusRingFunction · 0.90
mergePropsFunction · 0.90

Tested by

no test coverage detected