简体   繁体   中英

Firebas Firestore

I'm working on a project on react and this is my first time using firebase. I have set up my firebase config file in my app. I keep getting an error message (shown below) when I import db from my firebase.config.js file.

error message: export 'getFireStore' (imported as 'getFireStore') was not found in 'firebase/firestore'

my code:

enter code here

import { initializeApp } from 'firebase/app'
import { getFireStore } from 'firebase/firestore'

// Your web app's Firebase configuration
const firebaseConfig = {
// ...
}

// Initialize Firebase
const app = initializeApp(firebaseConfig)
export const db = getFireStore()

enter image description here

import firebase from "firebase/app";
import "firebase/firestore";
import "firebase/auth";

firebase.initializeApp({

});

const auth = firebase.auth();
const firestore = firebase.firestore();

export { auth, firestore };

TRY THIS CODE

你安装包火力基地使用

npm install firebase

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM