title: ReactJS: Create image id when clicked
body: <p>The following code displays a list of images on a webpage using React JS:</p>
  
  <pre><code>this.searchResultsList = this.searchResults.map(function(photo){
      return &lt;div className="dataSetBox" key={photo.toString()}&gt;&lt;img src={photo} alt="Image" height="350" width="450" margin="15px" border= "10" onClick={() =&gt; imageClick(id = "border")} /&gt;&lt;/div&gt;;
  })
  </code></pre>
  
  <p>When an image is clicked on the webpage, I want a border to appear around that image. 
   would surround the image with a black border. </p>
  
  <p>However, I want the border to only appear after the image has been clicked. My code above does not work and I get the error that <strong>id</strong> is not defined. Any idea how to fix it? </p>