在单个Reactjs项目中初始化两个firebase应用程序时出错

时间:2017-04-22 11:21:08

标签: firebase firebase-realtime-database

我在reactjs项目中初始化两个firebase应用程序时出现此错误。

未捕获的TypeError:r [t]不是函数

我的目标是读取/写入[default] firebase.database并写入名为“al”的第二个firebase.database。

fb版本:3.7.4;

我的config.js文件:

import * as firebase from 'firebase';

const config = {
  apiKey: "my_apiKey_from_fb_default",
  authDomain: "my_authDomain_fb_default",
  databaseURL: "my_databaseURL_fb_default",
  storageBucket: "my_storageBucket_fb_default",
  messagingSenderId: "my_messagingSenderId_fb_default"
};

const configAl = {
  apiKey: "my_apiKey_fb_al",
  authDomain: "my_authDomain_fb_al",
  databaseURL: "my_databaseURL_fb_al",
  storageBucket: "my_storageBucket_fb_al",
  messagingSenderId: "my_messagingSenderId_fb_al"
};

const firebaseApp = firebase.initializeApp(config);
const firebaseAl = firebase.initializeApp(configAl, "al");

// Default DB entry point
export const fbDB = firebaseApp.database();
export const fbAuth = firebaseApp.auth();

// Analytics DB entry point
export const fbAlDB = firebaseAl.database();

任何想法我做错了什么?

0 个答案:

没有答案