ascoders / react-native-image-viewer

🚀 tiny & fast lib for react native image viewer pan and zoom
MIT License
2.45k stars 580 forks source link

Dynamic change array of images #236

Open magworkss opened 6 years ago

magworkss commented 6 years ago

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.

ascoders commented 6 years ago

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

DragonSpirit commented 6 years ago

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

csath commented 5 years ago

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.

phsumi commented 5 years ago

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 :)

ascoders commented 5 years ago

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

Gfr1992 commented 3 years ago

Did you find any solution?