should reset internal imageIndex state after close
themez opened this issue · 1 comments
themez commented
I have a image list, click a specific item in the list would trigger image viewing modal open and show the clicked image.
import ImageView from 'react-native-image-viewing'
function MyImageViewer(props){
return <ImageView
images={props.images}
imageIndex={props.imageIndex}
visible={props.visible}
swipeToCloseEnabled={true}
HeaderComponent={(imageIndex) => <Text>{imageIndex}</Text>}
FooterComponent={(imageIndex) => <Text>{imageIndex}</Text>}
/>
}
The abnormal case is like that:
- click the first image to open image viewing modal and the modal presents image-0
- swipe to second image, the modal presents image-1
- close the image viewing modal
- click the first image to open image viewing modal
- the modal presents image-0, but the header and foot component received older imageIndex param: 1
eeshankeni commented
Thanks for the fix man, wish this package was actually maintained