hupe1980 / gatsby-theme-material-ui

Gatsby theme for Material-UI
MIT License
100 stars 44 forks source link

Outdated type definitions #111

Open javiertury opened 6 months ago

javiertury commented 6 months ago

This theme introduces outdated type definitions from old versions of @mui/material and it causes typing errors. For instance,

error TS2741: Property 'placeholder' is missing in type '{ children: string; color: "inherit"; variant: "contained"; }' but required in type 'Pick<{ children?: ReactNode; classes?: Partial<ButtonClasses> | undefined; color?: "inherit" | "primary" | "secondary" | "error" | "warning" | "info" | "success" | undefined; ... 9 more ...; variant?: "text" | ... 2 more ... | undefined; } & Omit<...> & CommonProps & Omit<...> & GatsbyProps, "to" | ... 283 more ... ...'.

181         <NavigationButton
             ~~~~~~~~~~~~~~~~

is caused by a Pick<ButtonProps, 'placeholder' ...>. The problem is that there is no placeholder to pick, so it resolves to { placeholder: unknown, ...} and typescript then thinks that the non-existing property placeholder is required.

This error seems similar to https://github.com/creativetimofficial/material-tailwind/issues/528.