简体   繁体   中英

how can you remove the default hover effect with MenuItem Mui class

im trying to remove the default gray hover over animation with MUI menu item class..

here are some examples that ive tried that Dont work.

<MenuItem divider sx={{'&:hover':{backgroundColor:'white'}}}>{`${selectedObj.tag.name}`}</MenuItem>
<MenuItem divider sx={{'&:hover':'none'}}>{`${selectedObj.tag.name}`}</MenuItem>

This should work with MUI version 5.10.16

<MenuItem divider sx={{ '&:hover': { backgroundColor: 'white' } }}>
      Hover me
</MenuItem>

Check this Demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM