title: Get link of an image in react-photo-gallery?
body: <p>I'm still a beginner in reactJS (using nodeJS backend) and I have to create a website to manage my collections. I don't know if what I'm going to ask you is feasible, but it probably is.</p>
  
  <p>So I'm using a react component, react-photo-gallery. It's a component where you can use url links and it mixes them together to create a beautiful gallery.</p>
  
  <p><a href="https://github.com/neptunian/react-photo-gallery" rel="nofollow noreferrer">https://github.com/neptunian/react-photo-gallery</a></p>
  
  <p>I'm using nodeJS to get the information from the database, where I get the urls of all the pictures. For example I have a collection of cards, and an url of the image which represents the collection. <strong>What I want to do is get the link of the picture that I'm clicking on so I can use it in another component.</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from 'react';
  import { render } from 'react-dom';
  import Gallery from 'react-photo-gallery';
  import Photo from './Photo';
  
  
  class PhotoGallery extends React.Component {
    constructor(props){
      super(props);
      this.onClick = this.onClick.bind(this);
      this.state = {
        urlImages: []
      };
    }
    async componentDidMount() {
      var getUrlImages = 'http://localhost:3004';
      const response = await fetch(getUrlImages+"/getUrlImages");
      const newList = await response.json();
      this.setState(previousState =&gt; ({
        ...previousState,
        urlImages: newList,
       }));
    }
  
    galleryPhotos() {
     if(this.state.urlImages) {
        return this.state.urlImages.map(function(urlimage) {
           return { src: urlimage.urlimage, width: 2, height: 2 }
        })
     }
  }
  
    onClick() {
      alert(this.galleryPhotos().value);
    }
  
    render() {
      return (
        &lt;Gallery axis={"xy"} photos={this.galleryPhotos()} onClick={this.onClick}/&gt;
      )
    }
  }
  const photos = [];
  export default PhotoGallery;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Basically what I want to do is get the source link of the picture in the onClick function. Is that possible?</p>
  
  <p>Thanks in advance!</p>