title: Most efficient way to pass parameters in onClick handler
body: <p>I am using inline arrow function to change the <code>onClick</code> handlers of some divs in my React component, but I know it is not a good way in terms of performance.</p>
  
  <p>Objectively, what is the most efficient way of setting <code>onClick</code> handlers that require arguments? This is what I have tried:</p>
  
  <p><strong>1. Inline arrow function</strong></p>
  
  <pre><code>changeRoute (routeName) {
    console.log(routeName)
  }
  render() {
    return (
      &lt;&gt;
        &lt;div onClick={() =&gt; this.changeRoute("page1")}&gt;1&lt;/div&gt;
        &lt;div onClick={() =&gt; this.changeRoute("page2")}&gt;2&lt;/div&gt;
      &lt;/&gt;
    )
  }
  </code></pre>
  
  <p><strong>2. If I use constructor binding then how can I pass props?</strong></p>
  
  <pre><code>constructor() {
    super(props)
    this.changeRoute = this.changeRoute.bind(this)
  }
  changeRoute (routeName) {
    console.log(routeName)
  }
  render() {
    return (
      &lt;&gt;
        &lt;div onClick={this.changeRoute}&gt;1&lt;/div&gt;
        &lt;div onClick={this.changeRoute}&gt;2&lt;/div&gt;
      &lt;/&gt;
    )
  }
  </code></pre>
  
  <p><strong>3. If I remove the arrow function then the function being called on the render itself</strong></p>
  
  <pre><code>changeRoute (routeName) {
    console.log(routeName)
  }
  render() {
    return (
      &lt;&gt;
        &lt;div onClick={this.changeRoute("page1")}&gt;1&lt;/div&gt;
        &lt;div onClick={this.changeRoute("page2")}&gt;2&lt;/div&gt;
      &lt;/&gt;
    )
  }
  </code></pre>
  
  <p><strong>4. If I use inline binding then it is also not best with performance</strong></p>
  
  <pre><code>changeRoute (routeName) {
    console.log(routeName)
  }
  render() {
    return (
      &lt;&gt;
        &lt;div onClick={this.changeRoute.bind(this, "page1")}&gt;1&lt;/div&gt;
        &lt;div onClick={this.changeRoute.bind(this, "page2")}&gt;2&lt;/div&gt;
      &lt;/&gt;
    )
  }
  </code></pre>
  
  <p>Then how can I proceed with the best way passing parameters?</p>