i was trying to import my firebase project to expo, but got the error "firebase.js:15 Uncaught TypeError: Cannot read properties of undefined (reading 'firestore')". I have my firestore app like this:
import firebase, { initializeApp } from "firebase/app";
import "firebase/firestore";
const firebaseConfig = {
apiKey: "xxx",
authDomain: "xxx",
projectId: "xxx",
storageBucket: "xxx",
messagingSenderId: "xxx",
appId: "xxx",
};
initializeApp(firebaseConfig);
const db = firebase.firestore();
export { db };
Also import the initializeapp from firebase, otherwise the error is "firebase.js:13 Uncaught TypeError: Cannot read properties of undefined (reading 'initializeApp')"
The version of firebase I'm using is "firebase": "^9.8.1",