* A dropdown menu can contain a menu.
(props)
| 14 | * A dropdown menu can contain a menu. |
| 15 | */ |
| 16 | function DropdownMenu(props) { |
| 17 | const { children, className, content, direction, open, scrolling } = props |
| 18 | const classes = cx( |
| 19 | direction, |
| 20 | useKeyOnly(open, 'visible'), |
| 21 | useKeyOnly(scrolling, 'scrolling'), |
| 22 | 'menu transition', |
| 23 | className, |
| 24 | ) |
| 25 | const rest = getUnhandledProps(DropdownMenu, props) |
| 26 | const ElementType = getElementType(DropdownMenu, props) |
| 27 | |
| 28 | return ( |
| 29 | <ElementType {...rest} className={classes}> |
| 30 | {childrenUtils.isNil(children) ? content : children} |
| 31 | </ElementType> |
| 32 | ) |
| 33 | } |
| 34 | |
| 35 | DropdownMenu.propTypes = { |
| 36 | /** An element type to render as (string or function). */ |
nothing calls this directly
no test coverage detected
searching dependent graphs…