如何使用主题更改 Material UI Select 或 Menu MenuItem 悬停样式

Art*_*nov 0 css typescript reactjs material-ui

我创建了自己的主题 import { createMuiTheme } from 'material-ui/styles';

export const MyTheme = createMuiTheme({
    palette: {
        primary: {
            light: '#757ce8',
            main: '#3f50b5',
            dark: '#002884',
            contrastText: '#fff',
        },
        secondary: {
            light: '#ff7961',
            main: '#f44336',
            dark: '#ba000d',
            contrastText: '#000',
        },
        error: {
            light: '#FF5F57',
            main: '#CE160C',
            dark: '#380300',
            //contrastText: will be calculated to contast with palette.primary.main
        }
    }
});
Run Code Online (Sandbox Code Playgroud)

在我的应用程序中使用它

<MuiThemeProvider theme={MyTheme}>
    <AppContainer>
        <BrowserRouter children={ routes } basename={ baseUrl } />
    </AppContainer>
</MuiThemeProvider>
Run Code Online (Sandbox Code Playgroud)

但是如何更改MenuItem主题中的悬停样式MenuSelect使用主题呢? 菜单 选择

Art*_*nov 7

使用主题实现悬停和选定项目样式

export const MyTheme = createMuiTheme({
    palette: {
        action: {
            selected: '#E7A615',
            hover: '#FFD371',
            disabled: '#9B9B9B'
        }
    }
});
Run Code Online (Sandbox Code Playgroud)