Recently, I am learning React by following closely some tutorials but I have reached a point where my web application is stuck because I have not set up correctly the integration between ReactJS and Firebase. This is what I have so far.
var React = require('react');
var ReactDOM = require('react-dom');
var ReactFire = require('reactfire');
var Firebase = require('firebase');
var FirebaseAPIKey = require('xxxx-xxxx');
var rootURL = 'https://fiery-torch-xxxx.firebaseio.com/';
var App = React.createClass({
mixins : [ReactFire],
componentWillMount : function(){
this.bindAsObject(Firebase.initializeApp(rootURL +'items/'),'items',FirebaseAPIKey);
},
render: function() {
return <h1>how are you doing? Are you okay?</h1>
}
});
var element = React.createElement(App, {});
ReactDOM.render(element, document.querySelector('.container'));
As you can see, I am using the version of FireBase 3.2.1 with ReactJS 15.2.0 but every time I run this web app I end up with the error that says my API Key is invalid. Any example that anyone can provide me to set up correctly this integration would be enormously appreciated ;)