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.
It is not correct to re-create Animated.Value on every render like this:
https://github.com/jobtoday/react-native-image-viewing/blob/8a91a9c370cb0e6820482b2262aacd1e25a718f7/src/hooks/usePanResponder.ts#L66-L67
https://github.com/jobtoday/react-native-image-viewing/blob/8a91a9c370cb0e6820482b2262aacd1e25a718f7/src/hooks/useAnimatedComponents.ts#L18-L19
https://github.com/jobtoday/react-native-image-viewing/blob/8a91a9c370cb0e6820482b2262aacd1e25a718f7/src/components/ImageItem/ImageItem.ios.tsx#L62-L64
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: https://github.com/bluesky-social/social-app/pull/1618