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

Setting state inside of onScaleStart/onScaleChange causes image flicker #76

Open
lovelistudios opened this issue May 16, 2024 · 0 comments

Comments

@lovelistudios
Copy link

Setting state inside of onScaleStart/onScaleChange causes image flicker

Note: I tried with the default renderItem function as well as a custom renderItem function that uses expo-image

I have 2 use cases for setting state inside of onScaleStart/onScaleChange:

  1. I would like to use a Gallery inside of a ScrollView. However, zooming does not work unless I disable scroll on the ScrollView. Therefore, I am trying to disable scrollEnabled via a callback inside of onScaleStart, then I will reenable scrollEnabled in onScaleEnd. I thought perhaps that the issue was that rerendering the ScrollView was expensive, so I tried to just setState on a local throwaway value instead that is not used. However, this still caused the image flicker.
  2. I would like to use a Gallery that does not take up the entire screen. However, when the user starts to Zoom, I would like to black out the rest of the screen and remove the header. I am trying to trigger these effects on either onScaleStart or have a gradual fadeout inside of onScaleChange.
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

1 participant