Interface: UploaderProps
The properties of the Uploader component.
Extends
DropzoneOptionsComponentProps<any>
Indexable
[
key:string]:any
Properties
accept?
optionalaccept?:AcceptGroup[] |Accept
Inherited from
DropzoneOptions.accept
action
action:
string
URL to upload files to.
autoFocus?
optionalautoFocus?:boolean
Inherited from
DropzoneOptions.autoFocus
disabled?
optionaldisabled?:boolean
If true, the children are in disabled state.
Overrides
DropzoneOptions.disabled
dropzone?
optionaldropzone?:boolean
If true, the dropzone will show.
getErrorMessage?
optionalgetErrorMessage?: (error,file) =>string
Override the message of any rejection error (built-in or custom). Called once per error;
receives the error and the file it belongs to and returns the message to use. Return
error.message for codes you don't want to change. Useful for localizing error messages.
Parameters
error
FileError
file
File
Returns
string
Inherited from
DropzoneOptions.getErrorMessage
getFilesFromEvent?
optionalgetFilesFromEvent?: (event) =>Promise<(DataTransferItem|File)[]>
Parameters
event
FileSystemFileHandle[] | DropEvent
Returns
Promise<(DataTransferItem | File)[]>
Inherited from
DropzoneOptions.getFilesFromEvent
maxFiles?
optionalmaxFiles?:number
Inherited from
DropzoneOptions.maxFiles
maxSize?
optionalmaxSize?:number
Inherited from
DropzoneOptions.maxSize
minSize?
optionalminSize?:number
Inherited from
DropzoneOptions.minSize
multiple?
optionalmultiple?:boolean
Inherited from
DropzoneOptions.multiple
noClick?
optionalnoClick?:boolean
Inherited from
DropzoneOptions.noClick
noDrag?
optionalnoDrag?:boolean
Inherited from
DropzoneOptions.noDrag
noDragEventsBubbling?
optionalnoDragEventsBubbling?:boolean
Inherited from
DropzoneOptions.noDragEventsBubbling
noKeyboard?
optionalnoKeyboard?:boolean
Inherited from
DropzoneOptions.noKeyboard
noPaste?
optionalnoPaste?:boolean
If true, disables paste-to-upload. By default, when the dropzone (or a focused child) receives a
paste that carries files - e.g. a screenshot pasted with Ctrl/Cmd+V - those files go through the
same accept/size/validator checks and onDrop callbacks as a drop. Pastes with no files
(plain text, etc.) are ignored and left untouched. See
https://github.com/react-dropzone/react-dropzone/issues/1210
Inherited from
DropzoneOptions.noPaste
onChange?
optionalonChange?:OnSuccess
Callback function called when files are successfully uploaded.
onDragEnter?
optionalonDragEnter?:DragEventHandler<HTMLElement>
Inherited from
DropzoneOptions.onDragEnter
onDragLeave?
optionalonDragLeave?:DragEventHandler<HTMLElement>
Inherited from
DropzoneOptions.onDragLeave
onDragOver?
optionalonDragOver?:DragEventHandler<HTMLElement>
Inherited from
DropzoneOptions.onDragOver
onDrop?
optionalonDrop?: <T>(acceptedFiles,fileRejections,event) =>void
Type Parameters
T
T extends File
Parameters
acceptedFiles
T[]
fileRejections
FileRejection[]
event
DropEvent
Returns
void
Inherited from
DropzoneOptions.onDrop
onDropAccepted?
optionalonDropAccepted?: <T>(files,event) =>void
Type Parameters
T
T extends File
Parameters
files
T[]
event
DropEvent
Returns
void
Inherited from
DropzoneOptions.onDropAccepted
onDropRejected?
optionalonDropRejected?: (fileRejections,event) =>void
Parameters
fileRejections
FileRejection[]
event
DropEvent
Returns
void
Inherited from
DropzoneOptions.onDropRejected
onError?
optionalonError?:OnError
Callback function called when an error occurs during upload.
Overrides
DropzoneOptions.onError
onFileDialogCancel?
optionalonFileDialogCancel?: () =>void
Returns
void
Inherited from
DropzoneOptions.onFileDialogCancel
onFileDialogOpen?
optionalonFileDialogOpen?: () =>void
Returns
void
Inherited from
DropzoneOptions.onFileDialogOpen
paste?
optionalpaste?:boolean
If true, pasting files (for example screenshots) into the uploader uploads them.
preventDropOnDocument?
optionalpreventDropOnDocument?:boolean
Inherited from
DropzoneOptions.preventDropOnDocument
readOnly?
optionalreadOnly?:boolean
If true, the children are in read-only state.
useFsAccessApi?
optionaluseFsAccessApi?:boolean
Inherited from
DropzoneOptions.useFsAccessApi
validator?
optionalvalidator?: <T>(file) =>Promise<ValidatorResult> |ValidatorResult
Custom validation, run once per file on drop/selection. Return null to accept the file, or a
FileError (or array of them) to reject it. May be async (return a Promise) to support
checks that can't run synchronously - e.g. reading image dimensions, inspecting file contents,
or calling an external service. While an async validator is pending, DropzoneState.isProcessing
is true, and onDrop/onDropAccepted/onDropRejected fire only once it settles. If the
validator throws or rejects, onError is called and the drop is discarded.
Note: the validator never runs during a drag (a DataTransferItem has no name/size), so a
validator-configured dropzone is isDragUnknown until drop.
Type Parameters
T
T extends File
Parameters
file
T
Returns
Promise<ValidatorResult> | ValidatorResult
Inherited from
DropzoneOptions.validator
value
value:
FileType[]
Current value of the uploader (array of uploaded files).