I am trying to setup many custom attributes to keep things semantically easy to update in the future. However I am having issues with having more than just one custom property in MUI v5
Ts Error
TS2717: Subsequent property declarations must have the same type. Property 'background' must be of type 'TypeBackground', but here has type 'PaletteColor'.
palette.ts
export const palette = {
primary: {
light: '#6D6B8C',
main: '#6514DD',
dark: '#6D6B8C',
},
secondary: {
main: '#6D6B8C',
},
error: {
main: '#bd4646',
},
background: {
main: '#fff',
paper: '#F5F5F5',
},
border: {
main: '#DADAE1',
primary: '#DADAE1',
},
text: {
primary: '#6D6B8C',
secondary: '#000',
},
}
declare module '@mui/material/styles' {
interface Palette {
border: Palette['primary']
background: Palette['primary']
}
// allow configuration using `createTheme`
interface PaletteOptions {
border?: PaletteOptions['primary']
background?: PaletteOptions['primary']
}
}