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

Function FunctionJSDoc

packages/dev/s2-docs/src/FunctionJSDoc.tsx:26–48  ·  view source on GitHub ↗
({function: func}: FunctionJSDocProps)

Source from the content-addressed store, hash-verified

24}
25
26export function FunctionJSDoc({function: func}: FunctionJSDocProps) {
27 let examples = Array.isArray(func.examples) ? func.examples.filter(Boolean) : [];
28
29 return (
30 <div className={style({marginBottom: 16})}>
31 <span className={style({font: 'body-lg'})}>
32 {renderHTMLfromMarkdown(func.description, {forceInline: false, forceBlock: true})}
33 </span>
34 {examples.map((example, index) => {
35 return (
36 <div key={index} className={style({marginTop: 12})}>
37 {examples.length > 1 && (
38 <strong className={style({font: 'title-sm'})}>Example {index + 1}:</strong>
39 )}
40 <pre className={standaloneCode}>
41 <Code lang="tsx">{example.trim()}</Code>
42 </pre>
43 </div>
44 );
45 })}
46 </div>
47 );
48}

Callers

nothing calls this directly

Calls 2

renderHTMLfromMarkdownFunction · 0.90
filterMethod · 0.65

Tested by

no test coverage detected