title: How to pass an object with onClick React?
body: <p>I have an object in an external file and I want to pass the <code>url</code> into the button <code>onClick</code> but I do not know to pass the value.</p>
  
  <p>Object:</p>
  
  <pre><code>const ProjectLists = [
  
      {
          id: "4",
          iconImage: "",
          name: "Simple",
          description: "Simple is a corporate responsive template and the absolutely clean &amp; modern template theme for your business. The theme was built by Foundation Framework and take advantages of it features: grid system, typography, buttons, form, UI element, section and more.",
          technologies: "HTML, CSS, JavaScript",
          href: "http://striped-dolls.surge.sh"
      }
  ]
  
  export default ProjectLists;
  </code></pre>
  
  <p>How to pass <code>ProjectLists.map((project, i) =&gt;</code> <code>href</code> in <code>map()</code> into <code>&lt;button&gt;</code></p>
  
  <pre><code>class Projects extends Component {
    render() {
      return (
        &lt;div&gt;
          {ProjectLists.map((project, i) =&gt;
  
          &lt;section className='section'&gt;
            &lt;div className='row'&gt;
              &lt;div className='col-sm'&gt;
                &lt;div className='content-left'&gt;
                  &lt;p key={project.id + i}&gt;
                    {project.iconImage}
                  &lt;/p&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div className='col-sm-8'&gt;
                &lt;div className='content-right text-left'&gt;
                  &lt;h1&gt;{project.name}&lt;/h1&gt;
                  &lt;p&gt;{project.description}&lt;/p&gt;
                  &lt;p&gt;Technologies: {project.technologies}&lt;/p&gt;
                  &lt;button type='submit' onClick=() =&gt; &lt;/button&gt;&gt;View live&lt;/button&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/section&gt;
          )}
        &lt;/div&gt;
      )
    }
  }
  </code></pre>
  
  <p>Thank you for your help!</p>