title: How to pass parameter from child to parent using function in react with es6 syntax
body: <p>I am having problem with react while passing argument from child to parent function .</p>
  
  <p>The parent class code is like this</p>
  
  <pre><code>setWebSite = (website) =&gt; () =&gt; {
    console.log(1);
  }
  
  getWebsites = () =&gt;{
          return (
              &lt;div&gt;
                  &lt;h2 className="text-center"&gt;Choose Website&lt;/h2&gt;
                  &lt;div className="row"&gt;
                      {this.state.websites &amp;&amp; this.state.websites.map((website)=&gt;{
                          return (
                              &lt;div className='col-sm-4' key={website._id}&gt;
                                  &lt;SingleWebsite website={website} key={website._id} setWebSite={this.setWebSite}/&gt;
                              &lt;/div&gt;
                          )
                      })}
                  &lt;/div&gt;
  
              &lt;/div&gt;
          )
  };
  </code></pre>
  
  <p>And the child class component is like this </p>
  
  <pre><code>const SingleWebsite = ({website,setWebSite})=&gt;{
  return (
    &lt;span onClick={()=&gt;{setWebSite(website.name)}}&gt;
        &lt;img  className="img img-responsive" style={{'width':'50%'}} src={'/images/'+ website.name +'.png'} /&gt;
    &lt;/span&gt;
  );
  </code></pre>
  
  <p>}</p>
  
  <p>The setWebsite function is not being called when onsubmit happens . I know something is wrong with my defining function of setWebSite but I don't know what it is . If I remove the parameter then it gets called . Any help will be appriciated</p>