Here, I am passing Url as an prop to display uploaded files in edit Modal. All I want is, to not show any attachment if Url is empty. I can srill see empty attachments like shown in image :
export const FileUploader = ({ label, Url, setUrl, editMode }) => {
console.log("Url", Url);
const props = {
maxCount: 1,
onChange(info) {
if (info.file.status !== "uploading") {
console.log(info.file, info.fileList);
}
},
fileList: [
Url ? {
uid: "1",
name: label + ".png",
status: "done",
response: '{"status": "success"}',
url: Url,
} : "",
],
};