MCPcopy Index your code
hub / github.com/adobe/react-spectrum / LinkButton

Function LinkButton

packages/dev/s2-docs/src/Link.tsx:37–46  ·  view source on GitHub ↗
({href, ...props}: LinkButtonProps)

Source from the content-addressed store, hash-verified

35}
36
37export function LinkButton({href, ...props}: LinkButtonProps) {
38 if (href?.startsWith('s2:') || href?.startsWith('react-aria:')) {
39 let url = new URL(href);
40 href = getBaseUrl(url.protocol.slice(0, -1) as any) + '/' + url.pathname;
41 }
42
43 return (
44 <S2LinkButton {...props} ref={registerSpectrumLink} href={href} {...getAnchorProps(href)} />
45 );
46}
47
48const baseUrl = getBaseUrl((process.env.LIBRARY as any) || 'react-aria');
49export function getAnchorProps(href) {

Callers

nothing calls this directly

Calls 3

getBaseUrlFunction · 0.90
sliceMethod · 0.80
getAnchorPropsFunction · 0.70

Tested by

no test coverage detected