diff --git a/src/components/ui/file-upload.tsx b/src/components/ui/file-upload.tsx index 014cbee..3c22ca5 100644 --- a/src/components/ui/file-upload.tsx +++ b/src/components/ui/file-upload.tsx @@ -46,7 +46,10 @@ const FileUpload = ({ className, children, dropzoneOptions, onChange, files: _fi const [files, setFiles] = React.useState(_files ?? []) const [errorMessages, setErrorMessages] = React.useState([]) - React.useEffect(() => onChange(files), [files]) + React.useEffect(() => { + onChange(files) + return undefined + }, [files]) const onDrop = React.useCallback>((acceptedFiles, fileRejections, event) => { dropzoneOptions?.onDrop?.(acceptedFiles, fileRejections, event)