I'm using "react-image-crop" (https://github.com/DominicTobias/react-image-crop) for cropping an image and then upload it to Firebase storage. The response from "react-image-crop" is a blob:URL in my state. When I call:
var storageRef = firebase.storage().ref();
var mountainImagesRef = storageRef.child(
"images/" + auth.uid + "/avatar.jpg"
);
mountainImagesRef.put(file).then(function(snapshot) {...
I get the error:
Firebase Storage: Invalid argument in `put` at index 0: Expected Blob or File.
I know that I need to pass a blob or file and not the URL but how can I fix this?
Thanks for your help!