The Menu components are used to perform some actions. Think of menus as a combination of lists and buttons. Menus are best suited for scenarios when you only want to show the menu items temporarily. The visibility of the menu and the menu items can be controlled via the component state.
Composing menus with state
How to do it...
Let's say that a component in your application has a menu button that, when clicked, displays a menu with several options in it. The options could change based on other pieces of state in the application, such as permissions, or the state of another resource. Here's the source to build this component:
import React, { Fragment, useState } from 'react';
import { makeStyles } from ...