A learner in React native and Firebase.
Here is my code to intialize firebase storage and fetch url for a storage path:
import { firebase } from '@react-native-firebase/storage';
var firebaseConfig = {
apiKey: "...",
authDomain: "...",
databaseURL: "...",
projectId: "...",
storageBucket: "...",
messagingSenderId: "...",
appId: "...",
measurementId: "..."
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
const storage = firebase.storage();
let imageRef = firebase.storage().ref('photos/flower.png');
console.log(imageRef);
I expect imageRef
to be containing url for the Firebase storage's image file.
But I get the error:
ERROR TypeError: undefined is not an object (evaluating '_firebase.firebase.storage')
I feel, the error is due to wrong package name import.
Could someone guide me on what is wrong?