duyluonglc / react-native-thumbnail-grid

75 stars 37 forks source link

Getting Proxy object instead of uri onPressImage #10

Closed dleonven closed 5 years ago

dleonven commented 5 years ago

I just made this question in stackoverflow (no answers):

https://stackoverflow.com/questions/54640229/onpressimage-in-photogrid-returns-proxy-object-instead-of-image-uri

onPressImage is returning the proxy object, not the uri.

I haven't been able to fix this.

I'd really appreciate any help thanks!

ManalLiaquat commented 5 years ago

I am also getting an object not an URI, if you fix this please let me know.

ManalLiaquat commented 5 years ago

@dleonven , I figured out this problem. You just need a second parameter. Like below

<PhotoGrid
   onPressImage={(eventObj, uri) => console.log(uri, "image uri")}
  />
dleonven commented 5 years ago

Awesome it works! Why is that?

ManalLiaquat commented 5 years ago

Awesome it works! Why is that?

@dleonven I go to the node_modules and find this library and then I found out that the function is returning the URI in the second parameter, and the first parameter only returning the obj.