title: In React, how to memorize an inline function when using functional components?
body: <p>The arrow functions have a performance issues,
  what should be the best approach to pass event and a parameter to event handler?</p>
  <p>For example:</p>
  <p>option 1:</p>
  <pre><code> &lt;div
      onClick={setPerson(name)}
   /&gt;
  
   const setPerson = (name) =&gt; (e: any): void =&gt; {
     setPerson(name)
     e.stopPropagation()
   }
  </code></pre>
  <p>option 2:</p>
  <pre><code>&lt;div
    onClick={(e) =&gt; setPerson(null, name, e)}
  /&gt;
  
   const setPerson = (name, e): void =&gt; {
     setPerson(name)
     e.stopPropagation()
   }
  </code></pre>