Last active
August 17, 2018 04:30
-
-
Save almond-bongbong/39bd537f0bd277ce01a9af27acc5a31e to your computer and use it in GitHub Desktop.
This file contains 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
imageToByteArray(e) { | |
const that = this; | |
const file = e.target.files[0]; | |
const reader = new FileReader(); | |
reader.onloadend = function() { | |
// with react | |
that.setState({img: reader.result}); | |
}; | |
reader.readAsDataURL(file); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment