Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always image is displaying from 0 index #163

Open
pratius opened this issue Nov 2, 2022 · 1 comment
Open

Always image is displaying from 0 index #163

pratius opened this issue Nov 2, 2022 · 1 comment

Comments

@pratius
Copy link

pratius commented Nov 2, 2022

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
Copy link

neutronm commented Nov 27, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants