material-table
material-table copied to clipboard
rowStyle prop with MuiThemeProvider
I need to use rowStyle like this:
rowStyle: rowData => ({
backgroundColor: this.state.selectedRow && this.state.selectedRow.tableData.id === rowData.tableData.id ? 'green' : 'white',
})
At the same time, I am using MuiThemeProvider to override some styles, like this:
const theme = createMuiTheme({
overrides: {
MuiTableCell: {
root: {
backgroundColor: 'white',
padding: '5px',
},
},
MuiTablePagination: {
toolbar: {
position: 'fixed',
top: '817px'
}
},
}
});
<MuiThemeProvider theme={theme}>
<MaterialTable>
...
</MaterialTable>
</MuiThemeProvider>
rowStyle prop does not work when I use MuiThemeProvider. The question is, how can I get them both to work?
Any help would be much appreciated!
Can't you just remove the cell background override (backgroundColor: 'white') ? As it's prioritary over row style i think.