接口不适用于const material类型。如何在这里注册sx的接口?我做了这件事,但它给了我一个错误
import { BoxProps } from '@mui/material';
interface Props {
sx: BoxProps['sx'];
}
export const test: Props = {
mb: 3,
};发布于 2022-08-10 09:13:14
接口定义了对象应该有一个sx属性。
因此,为了符合接口,您可以像这样定义test:
export const test: Props = {
sx: { mb: 3 },
};或更改接口:
type Props2 = BoxProps['sx']https://stackoverflow.com/questions/73303358
复制相似问题