I did read the doc over at firebase storage , but for some reason I cant get it to work.
I am using react and what I want is to be able to upload a file to my firebase storage, but I keep getting the error
TypeError: thisRef.put(...).then is not a function
I think I need different eyes on this.
Here is my function
uploadFile = (e) => {
e.preventDefault();
var file = this.refs.filePath.files[0];
var storageRef = firebase.storage().ref();
//dynamically set reference to the file name
var thisRef = storageRef.child(file.name);
//put request upload file to firebase storage
thisRef.put(file).then(function(snapshot) {
console.log('Uploaded a blob or file!');
});
}
UPDATE
The file uploads to the firebase storage, but it keep complaining about the promise (.then)
Here is the file that I am working on GitHub