title: react passing the parameter to a function that returns an async function
body: <p>In react how do I pass the identifier of the button that was clicked on to the parent component if my click handler returns an async function?</p>
  
  <p>In the parent:</p>
  
  <pre><code>jumpToItem = async () =&gt; {
    const { activeItem } = this.props;
    ...
  }
  </code></pre>
  
  <p>I'm passing to the handler to the child like this:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;ItemSelector activeItem={activeItemIndex} itemsCount={itemsNumber}  onClick={this.jumpToItem} /&gt;
  </code></pre>
  
  <p>In the child component:</p>
  
  <pre><code>return (
    &lt;Item key={index} {...itemProps} onClick={this.props.onClick} /&gt;
  );
  </code></pre>
  
  <p>Can I pass the index of the clicked item all the way up to <code>JumpToItem</code> ? Do I need to do something like this?</p>
  
  <pre><code>jumpToItem = async (index) =&gt; {
    const { activeItem } = this.props
    // ...do something with index...
  }
  </code></pre>
  
  <p>or do I have to pass the parameter like this:</p>
  
  <pre><code>jumpToItem(index) = async () =&gt; {
    const { activeItem } = this.props
    // ...do something with index...
  }
  </code></pre>