Firestore Databaseを初期化するときに躓いたのでその備忘録
firebase.js
import { initializeApp, getApps } from "firebase/app";
import {getFirestore} from "firebase/firestore"
import 'firebase/firestore';
const firebaseConfig = {
//apikey, authdomain, projectId, strageBucket, messagingSenderId, appId の情報を入力
};
let db;
if (!getApps().length) {
const app = initializeApp(firebaseConfig);
db = getFirestore(app);
}
export default db