-
Notifications
You must be signed in to change notification settings - Fork 287
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
Change imageIndex after initialization causes flickering #51
Comments
@matthewma7 Hi! did you find the solution to this yet? |
Same here. Any solution by anyone? Try removing it and you'll probably see the image does not update. |
@altany only solution i found is not to change the state variable which is being used by imageIndex property. But if you must change the imageIndex while the viewer is visible, unfortunately flicker is there and they haven't fixed it yet. |
for me it forked to randomly assign imageIndex only once when component is mounted and if image is changed, it only takes to refresh screen, may not be the best solution, but at least image is not flickering const randomValue = useMemo(()=>Math.random(), []) <Image src={{uri: https://image/image.jpg?id={randomValue}}}/> |
@matthewma7 @Ace000001 @altany have you got any success on this issue ? |
After some tests, I verified that by removing the onImageIndexChange prop the flickering stops. |
Reading @altany comment, I think
|
This solution meets my needs. Just make sure not to use a dynamic
|
Such a trivial bug and still not fixed. I want to create a gallery type of image viewing but this bug makes this useless. |
If the
imageIndex
changed when being visible, the component will flicker.It looks like it's caused by the key change by this line.
I am wondering why the key is needed.
The text was updated successfully, but these errors were encountered: