title: How to avoid anonymous function in react
body: <p>I have a scenario here</p>
  <pre><code>const Parent = () =&gt; {
      handleClick = (id) =&gt; {
          console.log(id)
      }
      return &lt;div&gt;
          users.map((user, index) =&gt; 
          &lt;child key={index} onClick={(user.id)=&gt;handleClick(user.id)} /&gt;)
      &lt;/div&gt;
  }
  </code></pre>
  <p>The child is using React.memo so it won’t re-render unless its props are changed. I don’t want the child to be re-render when the parent renders but in this scenario it will re-render because I am using an anonymous function. I can put <strong>handleClick</strong> inside of <strong>useCallback</strong>  but how can I avoid the anonymous function here. I have to use an anonymous function here because I am expecting some arguments here.</p>