title: icon inside button does not trigger attached function on React
body: <p>I am building app on React. I have a table of item list and have difficult invoking function on icon.</p>
  
  <p><a href="https://i.stack.imgur.com/x4YhF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x4YhF.png" alt="enter image description here"></a></p>
  
  <pre><code>deleteItem = event =&gt; {
      this.props.deleteRecord(event);
  };
  
  const RecordList = records.map(({ category, task, duration, id }, i) =&gt; (
          &lt;tr className="record-item" key={i} id={id}&gt;
              &lt;td&gt;
                  &lt;span className="recordItem"&gt;{category}&lt;/span&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;span&gt;{task}&lt;/span&gt;
              &lt;/td&gt;
              &lt;td className="time-trashIcon-container"&gt;
                  &lt;span&gt;{duration}&lt;/span&gt;
                  &lt;button
                      type="button"
                      className="trashIcon"
                      id={id}
                      onClick={this.deleteItem}
                  &gt;
                      &lt;i className="far fa-trash-alt" /&gt;
                  &lt;/button&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      ));
  </code></pre>
  
  <p><strong>What I want to achieve</strong></p>
  
  <p>when user clicks the trash button (icon inside button tag), it calls a function to delete item. </p>
  
  <p><strong>Problem</strong></p>
  
  <p>For now, <em>only when I click button padding, not icon itself</em> triggers delete function. Clicking icon does not trigger anything. </p>
  
  <p><strong>What I tried</strong> 
  I wrap the icon inside span and tried giving delete function as onClick eventListener. It would trigger a function but it fails to find property I want to pass <em>id of each item</em> which I need to delete the target item. </p>
  
  <p>I don't want to use jQuery. I have tried <code>data-x</code> to pass property and did not work either. Any help would be appreciated.</p>
  
  <p>Thank you tons in advance.</p>