我想在我的reactjs应用程序中使用firestore.
当我从firebase配置对象调用firestore时.
它说
firebase2.default.firestore is not a function
这是代码
import firebase from 'firebase' const config = { apiKey: "AIzaSxxxxxxqpUeqKXI",authDomain: "payxxxxxa1.firebaseapp.com",databaseURL: "https://payxxxxxxxa1.firebaseio.com",projectId: "payxxxxxxja1",storageBucket: "payxxxxxa1.appspot.com",messagingSenderId: "281xxxxxxxx576" } firebase.initializeApp(config) export const fire = firebase export const ref = firebase.database().ref() export const firebaseAuth = firebase.auth export const messaging = firebase.messaging(); export const db = firebase.firestore();
Firebase版本是4.5.0
npm list firebase > firebase@4.5.0
我做错了吗?
ES6:
import’@ firebase / firestore’