diff --git a/README.md b/README.md index 23d5ffc..82484ab 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ npm install react-file-reader --save ``` ## ChangeLog - - 1.0.4 - - adds the ability to return both base64 strings and an HTML5 FileList from handleFiles - 1.0.3 - bumps React version to 15.5 and fixes UNMET peer dependency with webpack - 1.0.2 @@ -87,18 +85,5 @@ handleFiles = files => { "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA..." ``` -### Both Base64 and HTML5 FileList -```javascript -handleFiles = (base64Files, fileList) => { - console.log(base64Files); - console.log(fileList); -} - - - - -``` -When `base64={true}`, `handleFiles` will return both the Base64 string and the HTML5 FileList object. - ## Copyright Copyright (c)2017 [Grillwork Inc](http://grillwork.io). See [LICENSE](https://github.com/GrillWork/react-file-reader/blob/master/LICENSE) for details. diff --git a/ReactFileReader.js b/ReactFileReader.js index a09c34f..3fb854c 100644 --- a/ReactFileReader.js +++ b/ReactFileReader.js @@ -35,7 +35,7 @@ export default class ReactFileReader extends React.Component { files.push(reader.result) if (files.length === ef.length) { - this.props.handleFiles(files, ef); + this.props.handleFiles(files); } } @@ -46,7 +46,7 @@ export default class ReactFileReader extends React.Component { let reader = new FileReader(); reader.onloadend = function (e) { - this.props.handleFiles(reader.result, ef) + this.props.handleFiles(reader.result) }.bind(this) reader.readAsDataURL(f) diff --git a/index.js b/index.js index bc69722..c27a1a9 100644 --- a/index.js +++ b/index.js @@ -69,7 +69,7 @@ var ReactFileReader = function (_React$Component) { files.push(reader.result); if (files.length === ef.length) { - _this.props.handleFiles(files, ef); + _this.props.handleFiles(files); } }; @@ -85,7 +85,7 @@ var ReactFileReader = function (_React$Component) { var _reader = new FileReader(); _reader.onloadend = function (e) { - this.props.handleFiles(_reader.result, ef); + this.props.handleFiles(_reader.result); }.bind(_this); _reader.readAsDataURL(f); diff --git a/package.json b/package.json index 6f251de..a9a1f45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-file-reader", - "version": "1.1.0", + "version": "1.0.3", "description": "A flexible ReactJS component for handling styled HTML file inputs.", "main": "index.js", "repository": "git@github.com:GrillWork/react-file-reader.git",