I am new on react and typescript. I am trying to extend the color palette on a global theme.
in my themeConitainer.tsx
import { ThemeOptions } from '@material-ui/core/styles/createMuiTheme';
declare module '@material-ui/core/styles/createPalette' {
// allow configuration using `createMuiTheme`
interface Palette {
accent: PaletteColor
}
interface PaletteOptions {
accent: PaletteColorOptions,
tertiary: PaletteColorOptions
}
};
const ThemeContainer: React.FunctionComponent<Props> = (props, themeOptions: ThemeOptions) => {
const { children } = props;
const theme = useMemo(() => {
const nextTheme = createMuiTheme({
...themeOptions,
palette: {
accent: {
main: '#ff0000'
},
}
});
return nextTheme;
});
return <ThemeProvider theme={theme}>{children}</ThemeProvider>;
};
export default ThemeContainer;
but on my component, there was an error.
No overload on this call.
Thank you in advance.
