title: Pass a parameter to an event handler or callback in React
body: <p>Why is</p>
  
  <pre><code>&lt;button onClick={() =&gt; this.handleClick(id)} /&gt;
  </code></pre>
  
  <p>equivalent to calling .bind:</p>
  
  <pre><code>&lt;button onClick={this.handleClick.bind(this, id)} /&gt;
  </code></pre>
  
  <p>ref: <a href="https://reactjs.org/docs/faq-functions.html" rel="nofollow noreferrer">https://reactjs.org/docs/faq-functions.html</a></p>
  
  <blockquote>
    <p>An arrow function expression has a shorter syntax than a function
    expression and does not have its own this, arguments, super, or
    new.target.</p>
  </blockquote>
  
  <p>ref: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions</a></p>
  
  <p>If arrow function does not have its own this, the 1st handleClick() would have a different this as compared to the 2nd one, no?</p>