Single MAP use in List in MUI REACT JS
const navItems = ['Home', 'About', 'Contact'];
function DrawerAppBar(props) {
const drawer = (
<Box onClick={handleDrawerToggle} sx={{ textAlign: 'center' }}>
<List>
// Single map decode
{navItems.map((item) => (
<ListItem key={item} disablePadding>
<ListItemButton sx={{ textAlign: 'center' }}>
<ListItemText primary={item} />
</ListItemButton>
</ListItem>
))}
</List>
</Box>
);
}
export default DrawerAppBar;
No comments:
Post a Comment