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

Function StaticTreeItem

packages/react-aria-components/test/Tree.test.tsx:58–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56let onExpandedChange = jest.fn();
57
58let StaticTreeItem = props => {
59 return (
60 <TreeItem {...props}>
61 <TreeItemContent>
62 {({isExpanded, hasChildItems, selectionMode, selectionBehavior}) => (
63 <>
64 {(selectionMode !== 'none' || props.href != null) &&
65 selectionBehavior === 'toggle' &&
66 (props.checkboxComponent === 'CheckboxField' ? (
67 <CheckboxField slot="selection">
68 <CheckboxButton />
69 </CheckboxField>
70 ) : (
71 <Checkbox slot="selection" />
72 ))}
73 {hasChildItems && <Button slot="chevron">{isExpanded ? '⏷' : '⏵'}</Button>}
74 <Text>{props.title || props.children}</Text>
75 <Button aria-label="Info">ⓘ</Button>
76 <Button aria-label="Menu">☰</Button>
77 </>
78 )}
79 </TreeItemContent>
80 {props.title && props.children}
81 </TreeItem>
82 );
83};
84
85let StaticTree = ({treeProps = {}, rowProps = {}}) => (
86 <Tree

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected