(props: AriaMenuProps<T> & {onSelect: () => void})
| 21 | import userEvent from '@testing-library/user-event'; |
| 22 | |
| 23 | function Menu<T extends object>(props: AriaMenuProps<T> & {onSelect: () => void}) { |
| 24 | // Create menu state based on the incoming props |
| 25 | let state = useTreeState(props); |
| 26 | |
| 27 | // Get props for the menu element |
| 28 | let ref = React.useRef(null); |
| 29 | let {menuProps} = useMenu(props, state, ref); |
| 30 | |
| 31 | return ( |
| 32 | <ul {...menuProps} ref={ref}> |
| 33 | {[...state.collection].map(item => ( |
| 34 | <MenuItem key={item.key} item={item} state={state} onAction={props.onSelect} /> |
| 35 | ))} |
| 36 | </ul> |
| 37 | ); |
| 38 | } |
| 39 | |
| 40 | function MenuItem({item, state, onAction}) { |
| 41 | // Get props for the menu item element |
nothing calls this directly
no test coverage detected