I am currently trying to implement a custom theme using the following code:
import Menu from '@material-ui/core/Menu';
import { createStyles, withStyles, Theme } from '@material-ui/core/styles';
const myMenu = withStyles( ( theme: Theme ) =>
createStyles( {
root: {
backgroundColor: theme.palette.primary.main,
},
} ),
)( Menu );
However, I am encountering the following error message:
Argument of type 'ComponentType<MenuProps>' is not assignable to parameter of type 'ComponentType<ConsistentWith<MenuProps, { classes: Record<"root", string>; }> | ConsistentWith<PropsWithChildren<MenuProps>, { ...; }>>'.
Type 'ComponentClass<MenuProps, any>' is not assignable to type 'ComponentType<ConsistentWith<MenuProps, { classes: Record<"root", string>; }> | ConsistentWith<PropsWithChildren<MenuProps>, { ...; }>>'.
Type 'ComponentClass<MenuProps, any>' is not assignable to type 'ComponentClass<ConsistentWith<MenuProps, { classes: Record<"root", string>; }> | ConsistentWith<PropsWithChildren<MenuProps>, { ...; }>, any>'.
Types of property 'propTypes' are incompatible.
Type 'WeakValidationMap<MenuProps> | undefined' is not assignable to type