Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual Download Example not working #44

Open
martykuentzel opened this issue Nov 15, 2019 · 0 comments
Open

Manual Download Example not working #44

martykuentzel opened this issue Nov 15, 2019 · 0 comments

Comments

@martykuentzel
Copy link

martykuentzel commented Nov 15, 2019

Hi,

first of all thank you for this nice package. I just wanted to report a small bug in your example that cost me some time to find. In order to spare other people from this I want to provide the fix.

In the last Section "Starting downloads manually"
customOnChangeHandler = (event) => { const { target: { files } } = event; const filesToStore = []; files.forEach(file => filesToStore.push(file)); this.setState({ files: filesToStore }); }

Line 298: files.forEach(file => filesToStore.push(file)) does not work because files is an object of objects which cannot use forEach.
Replace this line with

Object.values(files).map((file) => filesToStore.push(file));
and everything works as expected.

Best regards
Marty

Edit: Not sure how linebreak works in a codeblock. Two spaces are not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant