firebase-react-native-sample icon indicating copy to clipboard operation
firebase-react-native-sample copied to clipboard

initializing the db

Open ORESoftware opened this issue 8 years ago • 0 comments

Should we just do this?

const React = require("react-native");
const firebase = require("firebase");

// Initialize Firebase
const firebaseConfig = {
  apiKey: "<YOUR-API-KEY>",
  authDomain: "<YOUR-AUTH-DOMAIN>",
  databaseURL: "<YOUR-DATABASE-URL>",
  storageBucket: "",
};
firebase.initializeApp(firebaseConfig);

// Create a reference with .ref() instead of new Firebase(url)
const rootRef = firebase.database().ref();

export default rootRef;             // <<<<

assume we can just make this a module and initialize the db this way, but I am pretty new to Firebase

ORESoftware avatar Jan 31 '17 21:01 ORESoftware