I am creating custom typography. But while using I am getting below error.
I am following below document
https://mui.com/material-ui/api/typography/
here is my code https://codesandbox.io/s/fragrant-mountain-eukirg
import * as React from "react";
import Typography, { TypographyProps } from "@mui/material/Typography";
import { styled } from "@mui/material/styles";
const LabelXs = styled(Typography)<TypographyProps>(({ fontWeight }) => {
return {
fontSize: 15
};
});
export default LabelXs;
I am using like this
<LabelXs component={"div"}>Div element</LabelXs>
don't why it is showing error ?
[![Property 'component' does not exist on type 'IntrinsicAttributes & SystemProps<Theme> & { align?: "right" | "left" | "inherit" | "center" | "justify" | undefined; children?: ReactNode; ... 6 more ...; variantMapping?: Partial<...> | undefined; } & CommonProps & Omit<...> & MUIStyledCommonProps<...>'.ts(2322)][1]][1]
any suggestion ?
component props is present why you are saying it is not present
https://mui.com/material-ui/api/typography/

Typography.d.tsfile you will see that there is nocomponentprop. I do not why. You could edit that file if it makes any sense.