import React from 'react' ; import { useBaseMenuContext } from './BaseMenuContext' ; const BaseMenuTrigger = ( { children } ) => { const { openMenu } = useBaseMenuContext ( ) ; return ( < > { React . Children . map ( children , ( child ) => { return React . cloneElement ( child as any , { onClick : openMenu , [ 'aria-controls' ] : 'base-menu' , [ 'aria-haspopup' ] : 'true' , } ) ; } ) } < />); } ; export default BaseMenuTrigger ;