You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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.
The text was updated successfully, but these errors were encountered:
Same here. Also trying to setStateonIndexChange and the swipe is glitching.
I tried wrapping the gallery component in a react.memo and made sure that it's not rerendered upon state change but this did not fix it.
Same here. Also trying to setStateonIndexChange and the swipe is glitching. I tried wrapping the gallery component in a react.memo and made sure that it's not rerendered upon state change but this did not fix it.
Setting state inside of
onScaleStart
/onScaleChange
causes image flickerNote: 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
:Gallery
inside of aScrollView
. However, zooming does not work unless I disable scroll on theScrollView
. Therefore, I am trying to disablescrollEnabled
via a callback inside ofonScaleStart
, then I will reenablescrollEnabled
inonScaleEnd
. I thought perhaps that the issue was that rerendering theScrollView
was expensive, so I tried to justsetState
on a local throwaway value instead that is not used. However, this still caused the image flicker.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 eitheronScaleStart
or have a gradual fadeout inside ofonScaleChange
.The text was updated successfully, but these errors were encountered: