build error
This commit is contained in:
@@ -7,7 +7,7 @@ import { CloseCircle } from 'iconsax-react'
|
|||||||
type Props = {
|
type Props = {
|
||||||
label: string,
|
label: string,
|
||||||
isMultiple?: boolean,
|
isMultiple?: boolean,
|
||||||
onChange: (file: File[]) => void;
|
onChange?: (file: File[]) => void;
|
||||||
isReset?: boolean;
|
isReset?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +21,10 @@ const UploadBox: FC<Props> = (props: Props) => {
|
|||||||
const array = [...files]
|
const array = [...files]
|
||||||
array.push(acceptedFiles[0])
|
array.push(acceptedFiles[0])
|
||||||
setFiles(array)
|
setFiles(array)
|
||||||
props.onChange(array)
|
props.onChange && props.onChange(array)
|
||||||
} else {
|
} else {
|
||||||
setFiles([acceptedFiles[0]])
|
setFiles([acceptedFiles[0]])
|
||||||
props.onChange([acceptedFiles[0]])
|
props.onChange && props.onChange([acceptedFiles[0]])
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [files])
|
}, [files])
|
||||||
@@ -34,7 +34,7 @@ const UploadBox: FC<Props> = (props: Props) => {
|
|||||||
const array = [...files]
|
const array = [...files]
|
||||||
array.splice(index, 1)
|
array.splice(index, 1)
|
||||||
setFiles(array)
|
setFiles(array)
|
||||||
props.onChange(array)
|
props.onChange && props.onChange(array)
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user