我有这个setProd Hooks
export interface faceProduct {
readonly title: string;
readonly prodState: string;
readonly shipping: string;
readonly sold: string;
readonly alt: string;
readonly material: string;
readonly location: string;
readonly src: string[];
readonly color: string[];
readonly saiz: string[];
readonly price: string;
}
export interface faceProductList extends faceProduct {
readonly id: string;
readonly to: string;
}
const [prod, setProd] = useState<faceProductList>({});
我希望初始值是空的object.but,我得到了错误。
const [prod, setProd] = useState<faceProductList>(Object);
每件事都与它相关联的东西一起工作。
https://stackoverflow.com/questions/56519104
复制相似问题