react-native-image-viewer
react-native-image-viewer copied to clipboard
Dynamic change array of images
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.
It don't support change imageUrls dynamically right now, it seems dangerous if you change current seeing image.
Currently if images are changed it doesn't recalculate width and height of view
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.
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 :)
@csath Thanks a lot! But I still have some suggestions for the PR #265, and need your help.
Did you find any solution?