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

Function DropdownItem

starters/hooks/src/DropdownListBox.tsx:16–30  ·  view source on GitHub ↗
(props: ListBoxItemProps)

Source from the content-addressed store, hash-verified

14}
15
16export function DropdownItem(props: ListBoxItemProps) {
17 let textValue =
18 props.textValue || (typeof props.children === 'string' ? props.children : undefined);
19
20 return (
21 <ListBoxItem {...props} textValue={textValue} className="dropdown-item">
22 {composeRenderProps(props.children, (children, {isSelected}) => (
23 <>
24 {isSelected && <Check />}
25 {typeof children === 'string' ? <Text slot="label">{children}</Text> : children}
26 </>
27 ))}
28 </ListBoxItem>
29 );
30}

Callers

nothing calls this directly

Calls 1

composeRenderPropsFunction · 0.85

Tested by

no test coverage detected