title: Error: Reference.child failed: First argument was an invalid path = "[object Object]"
body: <p>I try to remove "competences" by ID </p>
  
  <p>DDB modele :
  competences </p>
  
  <pre><code>id(from firebase): - competence: "string"
                     - definition: "string"
                     - icon: "string"
  </code></pre>
  
  <p>i use :</p>
  
  <pre><code>  deleteData(key){
      firebase.database().ref('competences/').child(key).remove();
  }
  
   &lt;tbody&gt;
     {this.state.items.map((element) =&gt; {
          return (&lt;tr&gt;
                     &lt;td&gt;{element.competence}&lt;/td&gt;
                     &lt;td&gt;{element.definition}&lt;/td&gt;
                     &lt;td&gt;&lt;img src={element.icon} style={imgStyle}/&gt;&lt;/td&gt;
                     &lt;td&gt;&lt;button onclick={this.deleteData(element)}&gt;supp&lt;/button&gt;&lt;/td&gt;
                   &lt;/tr&gt;)
     })}
   &lt;/tbody&gt;
  </code></pre>
  
  <p>But i've a error :
  Error: Reference.child failed: First argument was an invalid path = "[object Object]". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"</p>
  
  <p><a href="https://i.stack.imgur.com/m2wuC.png" rel="nofollow noreferrer">console.log()</a></p>