Skip to content

Commit

Permalink
fix: "this" binding on "validateFiles" render prop function
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j committed May 1, 2019
1 parent 0f4bee0 commit 3398474
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Files.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Files extends React.Component<Props> {
this.id = generateId();
}

validateFiles(files: Array<SelectedFile> | Array<File>): Array<FileError> {
validateFiles = (files: Array<SelectedFile> | Array<File>): Array<FileError> => {
const { multiple, multipleMaxSize, multipleMaxCount, accept, maxSize } = this.props;

const errors: Array<FileError> = [];
Expand Down Expand Up @@ -135,7 +135,7 @@ class Files extends React.Component<Props> {
}

return errors;
}
};

processSelectedFiles = async (eventFiles: Array<File>) => {
if (eventFiles.length === 0) {
Expand Down

0 comments on commit 3398474

Please sign in to comment.