From 33984744c3b7491467e266467a87413fed9578d9 Mon Sep 17 00:00:00 2001 From: Adrian Smijulj Date: Wed, 1 May 2019 15:53:10 +0200 Subject: [PATCH] fix: "this" binding on "validateFiles" render prop function --- src/Files.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.js b/src/Files.js index f2bcff0..50d03a9 100644 --- a/src/Files.js +++ b/src/Files.js @@ -73,7 +73,7 @@ class Files extends React.Component { this.id = generateId(); } - validateFiles(files: Array | Array): Array { + validateFiles = (files: Array | Array): Array => { const { multiple, multipleMaxSize, multipleMaxCount, accept, maxSize } = this.props; const errors: Array = []; @@ -135,7 +135,7 @@ class Files extends React.Component { } return errors; - } + }; processSelectedFiles = async (eventFiles: Array) => { if (eventFiles.length === 0) {