title: Confirm Window in React
body: <p>I have this following code : </p>
  
  <pre><code>renderPosts() {
  return _.map(this.state.catalogue, (catalogue, key) =&gt; {
    return (
      &lt;div className="item col-md-3" key={key} id={key}&gt;
          &lt;img src={this.state.catalogue[key].avatarURL} height={150} with={150}/&gt;
          &lt;h3&gt;{catalogue.marque}&lt;/h3&gt;
          &lt;h4&gt;{catalogue.numero}&lt;/h4&gt;
          &lt;h4&gt;{catalogue.reference}&lt;/h4&gt;
          &lt;p&gt;{catalogue.cote}&lt;/p&gt;
          &lt;div className="text-center"&gt;
          &lt;button className="btn btn-danger" onClick={() =&gt; {if(window.confirm('Delete the item?')){this.removeToCollection.bind(this, key)};}}&gt;Supprimer&lt;/button&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
    )
   })
  }
  </code></pre>
  
  <p>And I have this function too: </p>
  
  <pre><code>removeToCollection(key, e) {
  
    const item = key;
    firebase.database().ref(`catalogue/${item}`).remove();
   }
  </code></pre>
  
  <p>When I use the function without a confirm window in my "onclick" button, the code work great. But when I want use a confirm window, the confirm window show when I click on my button, but my item is not delete. </p>
  
  <p>Any idea ?</p>
  
  <p>Thank for your help !</p>