Always image is displaying from 0 index
pratius opened this issue · 1 comments
pratius commented
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) } } />
neutronm commented
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.