i have a type ImageType and incoming props from parent, it can be an Object or Array of Objects. I'm cheking if prop is Object then get directly access the "src" property but as you can see i'm getting an error from typescript. Any idea how to solve ? Thanks
type Props = {
label?: string;
value: ImageType[] | ImageType;
multiple: boolean;
cls?: string;
getValue: (val: ImageType[]) => void;
folderInCloud: string;
[key: string]: any;
};
type ImageType = {
src: string;
alt: string;
};