Created
June 16, 2019 17:48
-
-
Save jsmanifest/fadbcc89efc36af4b9e7d9e6583fa618 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const onChange = (e) => { | |
if (e.target.files.length) { | |
const arrFiles = Array.from(e.target.files) | |
const files = arrFiles.map((file, index) => { | |
const src = window.URL.createObjectURL(file) | |
return { file, id: index, src } | |
}) | |
dispatch({ type: 'load', files }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment