title: How to pass arguments to functions in React js?
body: <ol>
  <li><p>I want to display person's email in the alert window. But, I do not know how to pass email as arguments to displayAlert method. Also, it wont let me use  either. So, I have to assign displayAlert methos to a variable and use it in onClick. I do not know why it wont let me call it directly. </p>
  
  <pre><code>class People extends React.Component{
  render (){
          var handleClick = this.displayAlert;
          var items = this.props.items.map(function(item) {
              return(
                  &lt;ul key = {item.id}&gt;
                      &lt;li&gt;
                          &lt;button onClick= {handleClick}&gt;{item.lastName + ', ' + item.firstName}&lt;/button&gt;
                      &lt;/li&gt;
                  &lt;/ul&gt;
              )
          });
          return (&lt;div&gt;{items}&lt;/div&gt;);
   }
  
  displayAlert (){
      alert('Hi');
  }
  }
  
   class PersonList extends React.Component{
       render () {
          return (
      &lt;div&gt;
          &lt;People items={this.props.people}/&gt; /* People is an array of people*/
      &lt;/div&gt;
      );
    }
  }
  </code></pre></li>
  </ol>