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

Function TypeLink

packages/dev/docs/src/TypeLink.js:19–41  ·  view source on GitHub ↗
({links, type})

Source from the content-addressed store, hash-verified

17import typographyStyles from '@adobe/spectrum-css-temp/components/typography/vars.css';
18
19export function TypeLink({links, type}) {
20 let registered = useContext(LinkContext);
21 registered.set(type.id, {type, links});
22
23 let used = getUsedLinks(type, links);
24 for (let id in used) {
25 registered.set(id, {type: used[id], links});
26 }
27
28 return (
29 <TypeContext.Provider value={links}>
30 <code className={`${typographyStyles['spectrum-Code4']}`}>
31 <a
32 href={'#' + type.id}
33 data-link={type.id}
34 className={`${styles.colorLink} token hljs-name`}
35 data-hover={styles['is-hovered']}>
36 {type.name}
37 </a>
38 </code>
39 </TypeContext.Provider>
40 );
41}

Callers

nothing calls this directly

Calls 2

getUsedLinksFunction · 0.90
setMethod · 0.45

Tested by

no test coverage detected