@@ -16,7 +16,7 @@ type FileRejectionError = { code: FileErrorCode, message: string } | null | bool
1616
1717type InputFile = ( FileWithPath | DataTransferItem ) & { size ?: number }
1818
19- type FileRejectReason = { file : InputFile ; errors : FileRejectionError [ ] }
19+ export type FileRejectReason = { file : InputFile ; errors : FileRejectionError [ ] }
2020
2121export interface FileUploadOptions {
2222 accept : FileAccept
@@ -29,7 +29,7 @@ export interface FileUploadOptions {
2929 onDragEnter : FileHandler
3030 onDragLeave : FileHandler
3131 onDragOver : FileHandler
32- onDrop : ( acceptedFiles : InputFile [ ] , rejectReasons : FileRejectReason [ ] , event : Event ) => void
32+ onDrop : ( acceptedFiles : any [ ] , rejectReasons : FileRejectReason [ ] , event : Event ) => void
3333 onDropAccepted : ( acceptedFiles : InputFile [ ] , event : Event ) => void
3434 onDropRejected : ( rejectReasons : FileRejectReason [ ] , event : Event ) => void
3535 onFileDialogCancel : ( ) => void
@@ -527,11 +527,11 @@ export function useDropzone(options: Partial<FileUploadOptions> = {}) {
527527 dispatch ( { type : 'reset' } )
528528 }
529529
530- const composeHandler = ( fn : ComposeFunction ) => ( optionsRef . value . disabled ? null : fn )
530+ const composeHandler = ( fn : ComposeFunction ) => ( optionsRef . value . disabled ? undefined : fn )
531531
532- const composeKeyboardHandler = ( fn : ComposeFunction ) => ( optionsRef . value . noKeyboard ? null : composeHandler ( fn ) )
532+ const composeKeyboardHandler = ( fn : ComposeFunction ) => ( optionsRef . value . noKeyboard ? undefined : composeHandler ( fn ) )
533533
534- const composeDragHandler = ( fn : ComposeFunction ) => ( optionsRef . value . noDrag ? null : composeHandler ( fn ) )
534+ const composeDragHandler = ( fn : ComposeFunction ) => ( optionsRef . value . noDrag ? undefined : composeHandler ( fn ) )
535535
536536 const getRootProps = ( {
537537 onKeyDown,
@@ -572,7 +572,7 @@ export function useDropzone(options: Partial<FileUploadOptions> = {}) {
572572 ...rest
573573 } : { onChange ?: ( ) => void ; onClick ?: ( ) => void } = { } ) {
574574 const inputProps = {
575- accept : optionsRef . value . accept ,
575+ accept : optionsRef . value . accept as string ,
576576 multiple : optionsRef . value . multiple ,
577577 style : 'display: none' ,
578578 type : 'file' ,
0 commit comments