react-dropzone v11.0.0 Release Notes
Release Date: 2020-04-26 // almost 4 years ago-
11.0.0 (2020-04-26)
๐ Features
๐ฅ BREAKING CHANGES
- The method signatures of
onDrop
andonDropRejected
as well as the return value ofuseDropzone
were changed in order to add the reasons why rejected files were rejected.
onDrop
BEFORE this change:onDrop?<T extends File>(acceptedFiles: T[], rejectedFiles: T[], event: DropEvent): void;
onDrop
AFTER this change:onDrop?<T extends File>(acceptedFiles: T[], fileRejections: FileRejection[], event: DropEvent): void;
onDropRejected
BEFORE this change:onDropRejected?<T extends File>(files: T[], event: DropEvent): void;
onDropRejected
AFTER this change:onDropRejected?(fileRejections: FileRejection[], event: DropEvent): void;
rejectedFiles
from the return value ofuseDropzone
was replaced with
fileRejections
.The defintion of a
FileRejection
is:export interface FileError { message: string; code: string; } export interface FileRejection { file: File; errors: FileError[]; }
- The method signatures of