Answer the question
In order to leave comments, you need to log in
Why can't the initial value of hooks be set to an empty object?
I have this 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>({});
const [prod, setProd] = useState<faceProductList>(Object);
Answer the question
In order to leave comments, you need to log in
what is it connected with
let s: string;
s = 182;
const [prod, setProd] = useState<FakeProductList | null>(null);
if (!prod) {
}
return (/* ... */);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question