Search code examples
react-nativeamazon-s3photo-gallery

onPressImage in PhotoGrid returns Proxy object instead of image URI


example of array with s3 URI's

  • The component displays the images correctly.

  • The problem is when I click an image. I try to console.log() the uri of the clicked image, but instead of the s3 uri, I get the Proxy object:

Proxy object returned on image click

  • My code (I had a problem with code snippet so uploaded an image):

enter image description here

  • ComponentDidMount is where I setState with URI's array (after API call to S3 bucket).

Any idea on how can I get the clicked image s3 URI?

Thanks!


Solution

  • So this issue was answered in the package github. It just needed a second parameter, like this:

    <PhotoGrid
       onPressImage={(eventObj, uri) => console.log("image uri", uri)}
    />
    

    Cheers!