Skip to content

I want to change subrow css #261

Answered by KevinVandy
ChanoPark asked this question in Q&A
Discussion options

You must be logged in to vote

Welp don't do it that way. Manual mutations like that in React are not good. Just use the muiTableBodyCellProps directly in your column definitions. I suggest reading the Customizing Components Guide Docs where this is discussed

You probably want something like

muiTableBodyCellProps: ({ cell, row }) => ({ //get your data from row.original probably
  sx: {
    fontWeight: condition ? 'bold' : 'normal'
  }
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ChanoPark
Comment options

Answer selected by KevinVandy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants