react-native-image-viewer icon indicating copy to clipboard operation
react-native-image-viewer copied to clipboard

Dynamic change array of images

Open magworkss opened this issue 5 years ago • 6 comments

How can I change imageUrls props dynamically ? When I Add/Remove element from imageUrls which stored in my state the component does render/show current images instead of I see empty screen.

magworkss avatar Sep 24 '18 15:09 magworkss

It don't support change imageUrls dynamically right now, it seems dangerous if you change current seeing image.

ascoders avatar Sep 25 '18 07:09 ascoders

Currently if images are changed it doesn't recalculate width and height of view

DragonSpirit avatar Sep 28 '18 12:09 DragonSpirit

Any progress on this? Please find the PR https://github.com/ascoders/react-native-image-viewer/pull/265 this works for me. I reinitialize if the imageUrls length is greater than the previous value.

csath avatar Nov 19 '18 07:11 csath

My 0.02$: I wouldn't just allow changes of the image URLs, but the "data source" shouldn't have to be an array of URLs in the first place.

If we could just provide an array of arbitrary components, we could do quite exciting stuff (e.g. doing lazy loading with showing a progress bar first and only load the image when we need it).

As a cheaper alternative, a list of functions that eventually return a URL would be awesome. This would make the library already quite flexible :)

phsumi avatar Dec 30 '18 12:12 phsumi

@csath Thanks a lot! But I still have some suggestions for the PR #265, and need your help.

ascoders avatar Dec 31 '18 03:12 ascoders

Did you find any solution?

Gfr1992 avatar Jun 04 '21 23:06 Gfr1992