title: How do I add a React form data to a Firebase real-time database?
body: <p>I am an new to reactjs. I am using <code>fireadmin dynamic admin panel</code> purchased version,in this panel i have created a page which contain a form.Now i wanted to save that form value to my firebase database.This admin panel has functionality to add data using schema file.But i wanted to add data from front end.I have followed the tutorial <a href="http://fireadmin.mobidonia.com/videos.php" rel="nofollow noreferrer">video tutorial</a>. If u have any guidance please let me know.it also gives me error firebase is not function.</p>
  
  <p>my function </p>
  
  <pre><code> import Config from   '../config/app';    
   import DbConfig from   '../config/database';
      handleChange(event) {
          this.setState({value: event.target.value});
      }
  
  
  addMessage(e){
      e.preventDefault(); // &lt;- prevent form submit from reloading the page
      /* Send the message to Firebase */
     DbConfig.database().ref('billing').push(this.inputEl.value,this.inputEm.value);
  
      this.inputEl.value = ''; // &lt;- clear the input
      this.inputEm.value = ''; 
    }
  
            render() {
          return (
                  &lt;div className="content"&gt;
                  &lt;NavBar&gt;&lt;/NavBar&gt;
            &lt;div className="row"&gt;
              &lt;div className="col-md-10"&gt;
                  &lt;div className="card"&gt;
                      &lt;form onSubmit={this.addMessage.bind(this)}&gt;
        &lt;input type="text" ref={ el =&gt; this.inputEl = el }/&gt;
        &lt;input type="text" ref={ em =&gt; this.inputEm = em }/&gt;
        &lt;input type="submit"/&gt;
  
      &lt;/form&gt;
              &lt;/div&gt;
  
            &lt;/div&gt;
                  &lt;/div&gt;
          )
        }
  </code></pre>
  
  <p>database.js</p>
  
  <pre><code> import * as firebase from 'firebase';
  require("firebase/firestore");
  import Config from './app';
  
  var FbApp = firebase.initializeApp(Config.firebaseConfig);
  module.exports = FbApp; //this doesnt have to be database only
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>  //FireBase
       exports.firebaseConfig = {
           apiKey: "AIzaSyDsPufr5Dhusqal0bB8VDD9N6yv9u0Lo1E",
           authDomain: "tester-8e38d.firebaseapp.com",
           databaseURL: "https://tester-8e38d.firebaseio.com",
           projectId: "tester-8e38d",
           storageBucket: "tester-8e38d.appspot.com",
           messagingSenderId: "490493205074"
       };
  </code></pre>