Skip to main content

useMenu

Introduction

The useMenu hook is used internally to maintain the status of menu. The state of any opened menu is controlled through this hook. You can use this to implement a menu.

PropertyTypeDescriptionOptional
menuAnchorHTMLElement | nullThe element to which the menu is anchored.✔️
openMenuReact.MouseEventHandler<HTMLElement>Function to open the menu on a click event.
closeMenuZeroArgVoidReturnsFunction to close the menu.

Reference

For reference checkout this file