jobtoday/react-native-image-viewing

Always image is displaying from 0 index

pratius opened this issue · 1 comments

Hi,

I cannot display the selected index image using this package.
Can you please help me to resolve anyone.? Thanks.

Below is my code
<ImageView images={imageData} imageIndex={currentImageIndex || 0} onImageIndexChange={(index) => { setImageIndex(index) } } />

the problem is in your code, not in the library.
change the imageIndex={currentImageIndex || 0} to imageIndex={currentImageIndex ? currentImageIndex : 0} or just imageIndex={currentImageIndex}

it also depends on how you defined currentImageIndex.