diff --git a/packages/web-react/src/components/FileUploader/useFileUploaderAttachment.ts b/packages/web-react/src/components/FileUploader/useFileUploaderAttachment.ts index daec6140db..ebc1e658bd 100644 --- a/packages/web-react/src/components/FileUploader/useFileUploaderAttachment.ts +++ b/packages/web-react/src/components/FileUploader/useFileUploaderAttachment.ts @@ -19,7 +19,7 @@ export const useFileUploaderAttachment = ({ onError, }: UseFileUploaderAttachmentProps) => { useIsomorphicLayoutEffect(() => { - const createAttachmentInput = (metadata: FileMetadata) => { + const createAttachmentInput = (metadata?: FileMetadata) => { attachmentRef.current?.querySelectorAll('input').forEach((element) => element.remove()); const attachmentInputElement = getAttachmentInput(file, name, onError); attachmentInputElement && attachmentRef.current?.appendChild(attachmentInputElement); @@ -30,6 +30,6 @@ export const useFileUploaderAttachment = ({ } }; - meta && createAttachmentInput(meta); + createAttachmentInput(meta); }, [attachmentRef, file, name, meta, onError]); };