title: Not able to call the the method of the child component in react
body: <p>I have following components .</p>
  
  <p>this component accept props which is function that can be called.</p>
  
  <pre><code>deleteIcon = () =&gt; {
   console.log("deleting the document");
  }
  
      export const Parent = (props) =&gt; {
  
        return (
           &lt;button onclick={() =&gt; {deleteIcon()}}
        )
  
      }
  </code></pre>
  
  <p>Now, I have some another component which uses this component. which has its own implementation of the deleteIcon method. </p>
  
  <pre><code>deletechildIcon = () =&gt; {
  
  }
  
  export const child = () =&gt; {
       return (
     &lt;Parent deleteIcon={() =&gt; {deletechildIcon()}} /&gt;
   )
  }
  </code></pre>
  
  <p>So, from child still it is calling the parent method and not the child one. can any one help me with this ?</p>