This is in my theme.tsx:
Const baseTheme: Omit< ThemeOptions, | “properties1” | “properties2” > export DarkTheme = createTheme({ …baseTheme, …themeDark, palette: { …baseTheme.palette, mode: dark } }); function customDefaultThemeProvider({ children, theme = DarkTheme }: customDefaultThemeProviderProps) { return ( <ThemeProvider theme = {theme || DarkTheme}> {children} </ThemeProvider>); }
I have an error Type ‘Theme is missing the following properties from type ‘Theme’: properties1
, properties2
, properties3
, properties4
and 3 more. The error is coming from my "theme" from "theme = Darktheme".
It was working well until I installed another style package. I realized this new installed package was overwritting my themesOption and Themes and made some properties mandatory and add new properties through theme.d.ts.
These are the steps I did to resolve this:
- I added my own theme.d.ts file but it did not work.
- I added "Partial" and for my baseTheme and theme but it did not work.
createTheme
return? Maybe you could provide default values for these new properties.