Gcobani Mkontwana

Gcobani Mkontwana

  • 565
  • 1.9k
  • 407.9k

react-native is not loading due to misconfig with firebase.js

Apr 14 2023 7:31 PM

Hi Team

I need some help, i am using firebase version 9.19.1 and i have already register my app name on firebase console. eShopMobile. Now i am getting an issue with firebase.js that length is getting an error. Question how do i configure firebase version 9.19.1, when using react-native.

// Import the functions you need from the SDKs you need
import * as firebase from "firebase";
// TODO: Add SDKs for Firebase products that you want to use


// Your web app's Firebase configuration
const firebaseConfig = {
  apiKey: "*******",
  authDomain: "eshopmobile-fb508.firebaseapp.com",
  projectId: "eshopmobile-fb508",
  storageBucket: "eshopmobile-fb508.appspot.com",
  messagingSenderId: "734223583165",
  appId: "1:734223583165:web:6849ecf86323894686b4d4"
};



  // initialize firebase
  let app;

  if(!firebase.apps.length) {
    app = firebase.initializeApp(firebaseConfig);
  }
  

 // const auth = firebase.auth()
  
  export {firebase};

 


Answers (3)