jobtoday/react-native-image-viewing

Incorrect usage of Animated.Value causing gestures and state to be reset

gaearon opened this issue · 0 comments

It is not correct to re-create Animated.Value on every render like this:

This is not valid because Animated values are stateful, and so they should be kept in state or a ref. Otherwise, any state update to the component will interrupt the current animation and/or gesture.

I'm filing this for future readers or whoever has a fork of this code in their codebase.

A potential fix would look like this: bluesky-social/social-app#1618