title: call parent's function by child - React
body: <p>I want to call parent's function by a child. </p>
  
  <p>Parent Class.</p>
  
  <p>Here I have actions array that is creating columns in a child(eg: Edit column, which has &lt; Edit /> as an icon ) and I want to call 
  a onEditClick function of a parent when the user clicks on the edit icon.</p>
  
  <pre><code>onEditClick() {
      // this method should be called via child
  }
  
  render() {
      return (
        &lt;Child
          actions={[
            {
              name: "Edit",
              icon: (
                &lt;Tooltip title="Delete" className={classes.pointerStyle}&gt;
                  &lt;Edit /&gt;
                &lt;/Tooltip&gt;
              ),
              handler: "onEditClick"
            },
            {
              name: "Delete",
              icon: (
                &lt;Tooltip title="Delete" className={classes.pointerStyle}&gt;
                  &lt;DeleteIcon /&gt;
                &lt;/Tooltip&gt;
              ),
              handler: "onDeleteClick"
            }
          ]}
        /&gt;
      );
  }
  
  //Child class
  render() {
      return actions.map(col =&gt; (
        &lt;TableCell style={{ marginLeft: "5px" }}&gt;
          {col.icon} // here click event will occur
        &lt;/TableCell&gt;
      ));
  }
  </code></pre>