Currently, I am in the process of setting up custom typography variants in MUI5 by referencing this helpful guide: https://mui.com/customization/typography/#adding-amp-disabling-variants. As I follow step 2 and input the type definitions:
declare module '@mui/material/styles' {
interface TypographyVariants {
poster: React.CSSProperties;
}
// allow configuration using `createTheme`
interface TypographyVariantsOptions {
poster?: React.CSSProperties;
}
}
// Update the Typography's variant prop options
declare module '@mui/material/Typography' {
interface TypographyPropsVariantOverrides {
poster: true;
h3: false;
}
}
I save this code snippet into a file named typography.d.ts, making sure to replace the examples with my specific requirements. However, it appears that the entire module gets overwritten, causing errors like:
JSX element type 'Typography' does not have any construct or call signatures.
whenever attempting to utilize the Typography component, or
Module '"@mui/material/styles"' has no exported member 'createTheme'.
when trying to create a theme.
Do you have any insights on this issue?