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

Function getAnchorProps

packages/dev/s2-docs/src/Link.tsx:49–55  ·  view source on GitHub ↗
(href)

Source from the content-addressed store, hash-verified

47
48const baseUrl = getBaseUrl((process.env.LIBRARY as any) || 'react-aria');
49export function getAnchorProps(href) {
50 if (!/^http/.test(href) || href.startsWith(baseUrl)) {
51 return {};
52 }
53
54 return {target: '_blank', rel: 'noreferrer'};
55}
56
57const colorLink = style({
58 ...focusRing(),

Callers 2

LinkFunction · 0.70
LinkButtonFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected