メインコンテンツまでスキップ

Interface: UseDropZoneOptions

Defined in: react/src/hooks/useDropZone.ts:13

Extends​

  • Omit<DropZoneOptions, "onStateChange">

Properties​

accept?​

accept?: string;

Defined in: dom/dist/index.d.ts:121

Which files to take, written the way the accept attribute of a file input is: a comma separated list of extensions (.wav), MIME types (audio/wav) and type groups (audio/*).

Inherited from​

Omit.accept


disabled?​

disabled?: boolean;

Defined in: dom/dist/index.d.ts:135

Refuse the drop. The drag is still swallowed rather than let through: an unhandled drop makes the browser leave the page and open the file.

Default​

false

Inherited from​

Omit.disabled


multiple?​

multiple?: boolean;

Defined in: dom/dist/index.d.ts:128

Take more than one file from a single drop. With it off, only the first accepted file is reported, as a file input without multiple does.

Default​

false

Inherited from​

Omit.multiple


onDrop?​

onDrop?: (files, event) => void;

Defined in: dom/dist/index.d.ts:137

Called with the dropped files that match accept.

Parameters​

ParameterType
filesFile[]
eventDragEvent

Returns​

void

Inherited from​

Omit.onDrop


onReject?​

onReject?: (files, event) => void;

Defined in: dom/dist/index.d.ts:143

Called with the dropped files that do not match accept, so that the reason can be shown. It comes after onDrop for the same drop, so a list of rejected files can be cleared in onDrop and filled here.

Parameters​

ParameterType
filesFile[]
eventDragEvent

Returns​

void

Inherited from​

Omit.onReject