MCPcopy
hub / github.com/adobe/react-spectrum / MenuItem

Function MenuItem

packages/react-aria/test/menu/useMenu.test.tsx:40–51  ·  view source on GitHub ↗
({item, state, onAction})

Source from the content-addressed store, hash-verified

38}
39
40function MenuItem({item, state, onAction}) {
41 // Get props for the menu item element
42 let ref = React.useRef(null);
43 let {menuItemProps, isSelected} = useMenuItem({key: item.key, onAction}, state, ref);
44
45 return (
46 <li {...menuItemProps} ref={ref}>
47 {item.rendered}
48 {isSelected && <span aria-hidden="true">✅</span>}
49 </li>
50 );
51}
52
53interface VirtualizedMenuItemProps<T> {
54 item: {key: Key; rendered: React.ReactNode; index?: number};

Callers

nothing calls this directly

Calls 1

useMenuItemFunction · 0.90

Tested by

no test coverage detected