I am using firebase first time and stucked on it for 2 days. looked several example like on stackoverflow, but nothing works.
my firebase version is 3.4.2.
pushData(){
var Firebase = require("firebase");
var ref = new Firebase(" https://differentdatara.firebaseio.com");
var usersRef = ref.child("fish1");
usersRef.set({
alanisawesome: {
date_of_birth: "June 23, 1912",
full_name: "Alan Turing"
},
gracehop: {
date_of_birth: "December 9, 1906",
full_name: "Grace Hopper"
}
});
}
When ever i am running code it gives me "Firebase is not a constructor".
also tried with componentWillMount but nothing works. I try like this
componentWillMount(){
console.log('yesdoneit');
var Firebase = require("firebase");
this.FirebaseRef = new Firebase(" https://passwordsaves-11b33.firebaseio.com");
}
new <something>, that<something>needs to be a type. You are using a variable. Doesn't the Firebase object instead have a method you should use?