PhotoGrid中的onPressImage返回代理对象而不是图像URI

问题描述 投票:1回答:1

example of array with s3 URI's

  • 该组件正确显示图像。
  • 问题是当我点击图像时。我尝试console.log()点击的图像的uri,但我没有s3 uri,我得到了Proxy对象:

Proxy object returned on image click

  • 我的代码(我的代码片段有问题所以上传了一张图片):

enter image description here

  • ComponentDidMount是我使用URI数组的setState(在API调用S3存储桶之后)。

关于如何获得点击的图像s3 URI的任何想法?

谢谢!

react-native amazon-s3 photo-gallery
1个回答
0
投票

所以这个问题在github包中得到了回答。它只需要第二个参数,如下所示:

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

干杯!

© www.soinside.com 2019 - 2024. All rights reserved.