title: Remove data in React Firebase application
body: <p>I have this following code for import user data from Firebase to my React application : </p>
  
  <pre><code>import React from 'react';
  import AuthUserContext from './AuthUserContext';
  import withAuthorization from './withAuthorization';
  import * as firebase from 'firebase';
  import { config, database, db, auth, itembase, } from 
  '../firebase/firebase';
  
  class Collection extends React.Component {
  constructor (props) {
    super(props)
    this.state = {
      collection: []
    };
  
  }
  
  //Data from Firebase Database
  componentDidMount() {
    var userUid = firebase.auth().currentUser.uid;
    const collection = firebase.database().ref(`/users/${userUid}/collection/`)
  
    collection.on('value', snapshot =&gt; {
      this.setState({
        collection: snapshot.val(),
      })
    })
  }
  
  //Remove from user collection
  removeToCollection(key, e) {
    const userUid = firebase.auth().currentUser.uid;
    const item = {
      nom: this.state.collection[key].nom,
      parution: this.state.collection[key].parution
    };
    firebase.database().ref(`users/${userUid}/collection/`).remove(item)
  
   }
  
  render(){
    const collection= Object.keys(this.state.collection).map(key =&gt; {
      return (
        &lt;div key={key}&gt;
          &lt;h3&gt;{this.state.collection[key].nom}&lt;/h3&gt;
          &lt;p&gt;{this.state.collection[key].parution}&lt;/p&gt;
          &lt;button className="btn btn-danger" onClick={this.removeToCollection.bind(this, key)}&gt;Remove&lt;/button&gt; &lt;/div&gt;
          )
        });
      return (
        &lt;div&gt;
          {collection}
        &lt;/div&gt;
      )
   }
  
  }
  
  const authCondition = (authUser) =&gt; !!authUser;
  
  export default withAuthorization(authCondition)(Collection);
  </code></pre>
  
  <p>Like you can see, I have a function for remove data when the user click on the remove button. 
  My problem is that when I click the button, I get an error message that appears</p>
  
  <p><img src="https://i.stack.imgur.com/OHMC1.png" alt="Error message"></p>
  
  <p>And here is what my database looks like: </p>
  
  <p><img src="https://i.stack.imgur.com/heh8X.png" alt="screenshot database"></p>
  
  <p>Thank a lot in advance for your help !</p>