ParseReact
ParseReact copied to clipboard
Render image from Parse
Using react native I am able to select an image from the camera roll and successfully upload it to Parse. However, I am having trouble retrieving that same image from Parse and rendering it in a new view. I am able to retrieve other fields like so: this.data.user.phone but setting the image uri to this.data.user.image isn't successful.
I am uploading the image like this:
var image = 'data:image/png;base64,' + this.state.avatarSource;
var imageFile = new Parse.File("avatar.jpg", {base64: image});
return imageFile.save().then(function () {
return ParseReact.Mutation.Set(this.data.event[0], {'image':imageFile}).dispatch();
}
Hi, why do you do ParseReact.Mutation after a save?
You know I'm not really sure why I'm doing that other than that I stumbled across that snippet of code, used it, and it seemed to work.