When I import firebase on react-native then faces some issues like this.
import * as firebase from "firebase";
var firebaseConfig = {
apiKey: "[data_private]",
authDomain: "[data_private]",
databaseURL: "https://[data_private].firebaseio.com",
projectId: "[data_private]",
storageBucket: "[data_private]",
messagingSenderId: "[data_private]",
appId: "[data_private]"
};
firebase.initializeApp(firebaseConfig);
According to the docs:
First you need to install firebase
package:
npm install --save firebase
Then import it using firebase/app
:
// Firebase App (the core Firebase SDK) is always required and
// must be listed before other Firebase SDKs
import * as firebase from "firebase/app";