Skip to content

Commit

Permalink
fix: add missing onError type
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandjitsu committed May 3, 2022
1 parent 2d33fdf commit 7aff9a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions typings/react-dropzone.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type DropzoneOptions = Pick<React.HTMLProps<HTMLElement>, PropTypes> & {
) => Promise<Array<File | DataTransferItem>>;
onFileDialogCancel?: () => void;
onFileDialogOpen?: () => void;
onError?: (err: Error) => void;
validator?: <T extends File>(file: T) => FileError | FileError[] | null;
useFsAccessApi?: boolean;
autoFocus?: boolean;
Expand Down
4 changes: 4 additions & 0 deletions typings/tests/all.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ export default class Test extends React.Component {
onDropRejected={(files, event) => console.log(files, event)}
onFileDialogCancel={() => console.log("onFileDialogCancel invoked")}
onFileDialogOpen={() => console.log("onFileDialogOpen invoked")}
onError={(e) => console.log(e)}
validator={(f) => ({ message: f.name, code: "" })}
minSize={2000}
maxSize={Infinity}
maxFiles={100}
preventDropOnDocument
noClick={false}
noKeyboard={false}
Expand All @@ -29,6 +32,7 @@ export default class Test extends React.Component {
"image/*": [".png"],
}}
useFsAccessApi={false}
autoFocus
>
{({ getRootProps, getInputProps }) => (
<div {...getRootProps()}>
Expand Down

0 comments on commit 7aff9a5

Please sign in to comment.