I'm using MUI v5 and I'm trying to add a new prop to the TableRow componenent. MUI documentation on module augmentation lacks some examples, since it only shows how to add new variants (but not new props).
I tried with
declare module '@mui/material/TableRow' {
interface TableRowProps {
clickable?: boolean;
}
}
And in my theme I added the style:
MuiTableRow: {
styleOverrides: {
root: {
height: '80px',
},
head: {
height: 'unset',
},
},
variants: [
{
props: { clickable: true },
style: {
'&:hover': {
cursor: 'pointer',
},
},
},
],
},
I don't have any TS error on my theme override, but when using the component, TS throws an error saying the clickable prop doesn't exist:
How should I correctly add this new prop without wrapping it in a new component?
