Created
September 3, 2019 03:13
-
-
Save rudyhuynh/f8eafe5788ef5822f8bb5fc78ed450b3 to your computer and use it in GitHub Desktop.
read file with FileReader
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
const uploadFile = e => { | |
const file = e.target.files[0]; | |
const fr = new FileReader(); | |
fr.onload = () => { | |
initialState.queryBuilderState = JSON.parse(fr.result); | |
forceReRender(); | |
}; | |
fr.readAsText(file); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment