material ui中的网格组件



我有这个代码,我得到了这个错误:

No overload matches this call.
Overload 1 of 2, '(props: { component: ElementType<any>; } & SystemProps<Theme> & { children?: ReactNode; classes?: Partial<GridClasses>; ... 14 more ...; zeroMinWidth?: boolean; } & CommonProps & Omit<...>): Element', gave the following error.
Property 'component' is missing in type '{ children: Element; item: true; lg: 4; mmd: number; md: 3; ssm: number; sm: 4; key: string; }' but required in type '{ component: ElementType<any>; }'.
Overload 2 of 2, '(props: DefaultComponentProps<GridTypeMap<{}, "div">>): Element', gave the following error.
Type '{ children: Element; item: true; lg: 4; mmd: number; md: 3; ssm: number; sm: 4; key: string; }' is not assignable to type 'IntrinsicAttributes & SystemProps<Theme> & { children?: ReactNode; classes?: Partial<GridClasses>; ... 14 more ...; zeroMinWidth?: boolean; } & CommonProps & Omit<...>'.
Property 'mmd' does not exist on type 'IntrinsicAttributes & SystemProps<Theme> & { children?: ReactNode; classes?: Partial<GridClasses>; ... 14 more ...; zeroMinWidth?: boolean; } & CommonProps & Omit<...>'.ts(2769)
OverridableComponent.d.ts(17, 7): 'component' is declared here.
<Grid
item
lg={4}
mmd={4}
md={3}
ssm={6}
sm={4}
key={`col${item.id}`}
>

为什么会出现这种错误?

我发现了发生这种情况的原因。因为我在网格中使用mmd,它无法识别

最新更新