当我选择其中之一时,我正在尝试更改菜单中的选定属性。该方法如何切换? (React.js)
<NavigationButton to="/" label="Dashboard" exact>
<MenuItem className={classes.menuItem} selected={true}>
<ListItemIcon className={classes.icon}>
<Home />
</ListItemIcon>
<ListItemText classes={{primary: classes.primary}} inset primary="text1" />
</MenuItem>
</NavigationButton>
<NavigationButton to="/payment" label="Payment" exact>
<MenuItem className={classes.menuItem}>
<ListItemIcon className={classes.icon}>
<Payment />
</ListItemIcon>
<ListItemText classes={{primary: classes.primary}} inset primary="text2" />
</MenuItem>
</NavigationButton>