alwx / react-native-photo-view

Pinch-to-zoom view for React Native (both iOS and Android)
MIT License
816 stars 434 forks source link

Not possible to re-render when the image is updated. #121

Open ggozad opened 6 years ago

ggozad commented 6 years ago

Hey, We initially show a preview of the image which has been scaled down. Once the large version is loaded the state is updated and render is called again, but the preview is still the image shown. Tried using loadingIndicatorSource but that is not implemented on iOS afaik. What's missing from forcing a proper render?

Tom32i commented 6 years ago

Same here: replacing the source (to show an other image) does not refresh the PhotoView.

Note: quick/dirty fix, you can specify a different key attribute when the source change to force React to re-redenr the whole PhotoView component:

<PhotoView key={`page-${index}`}  source={{ uri: pages[index] }} />