title: React parent function doesn't receive child parameters
body: <p>I'm facing a strange problem.</p>
  <p>I created my function copy in my parent component.</p>
  <pre><code>const copy = (field, menu) =&gt; {
      console.log({ field, menu, localMetaSpec });
  
      localMetaSpec.menus[menu.id].elements.splice(
          localMetaSpec.menus[menu.id].elements.length,
          0,
        { ...field, id: uuid() }
      );
      return localMetaSpec;
  };
  </code></pre>
  <p>Then I gave it to my child component, and I called it like this</p>
  <pre><code>[...]
  case 'copy':
       return (
           &lt;Tooltip title='Copy'&gt;
               &lt;IconButton
                 aria-label='copy'
                 onClick={() =&gt; {
                   console.log(field);
                   console.log(menu);
                   actions.copy(field, menu);
                 }}
               &gt;
               &lt;FileCopyIcon /&gt;
           &lt;/IconButton&gt;
       &lt;/Tooltip&gt;
      );
  [...]
  </code></pre>
  <p>As you can see in the console, <strong>field</strong> and <strong>menu</strong> are <em>objects</em>, but when received as a parameter in the function they become <em>undefined</em>.
  <a href="https://i.stack.imgur.com/utW4D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/utW4D.png" alt="enter image description here" /></a></p>
  <p>Why this is happening?</p>