react-native-image-view icon indicating copy to clipboard operation
react-native-image-view copied to clipboard

added support for new reanimated version

Open jailsonpaca opened this issue 3 years ago • 1 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-image-view/src/ImageView.js b/node_modules/react-native-image-view/src/ImageView.js
index f0c1992..5f69756 100644
--- a/node_modules/react-native-image-view/src/ImageView.js
+++ b/node_modules/react-native-image-view/src/ImageView.js
@@ -204,13 +204,14 @@ export default class ImageView extends Component<PropsType, StateType> {
                 Animated.timing(this.modalAnimation, {
                     duration: 400,
                     toValue: 1,
+                    useNativeDriver: false,
                 }).start();
             }
         }
     }
 
     componentWillUnmount() {
-        Dimensions.removeEventListener('change', this.onChangeDimension);
+        Dimensions.removeEventListener?.('change', this.onChangeDimension);
 
         if (this.glideAlwaysTimer) {
             clearTimeout(this.glideAlwaysTimer);
@@ -436,6 +437,7 @@ export default class ImageView extends Component<PropsType, StateType> {
                 Animated.timing(this.imageScaleValue, {
                     toValue: scale,
                     duration: 300,
+                    useNativeDriver: false,
                 }).start();
 
                 this.togglePanels(scale === imageInitialScale);
@@ -459,15 +461,18 @@ export default class ImageView extends Component<PropsType, StateType> {
                     ? Animated.timing(this.modalBackgroundOpacity, {
                           toValue: 0,
                           duration: 100,
+                          useNativeDriver: false,
                       })
                     : null,
                 Animated.timing(this.imageTranslateValue.x, {
                     toValue: x,
                     duration: 100,
+                    useNativeDriver: false,
                 }),
                 Animated.timing(this.imageTranslateValue.y, {
                     toValue: y,
                     duration: 100,
+                    useNativeDriver: false,
                 }),
             ].filter(Boolean)
         ).start();
@@ -481,6 +486,7 @@ export default class ImageView extends Component<PropsType, StateType> {
             Animated.timing(this.imageTranslateValue.y, {
                 toValue: y + 400 * vy,
                 duration: 150,
+                useNativeDriver: false,
             }).start(this.close);
         }
 

This issue body was partially generated by patch-package.

jailsonpaca avatar Nov 09 '22 18:11 jailsonpaca

We had to do patch as well, any updates on this?

aureosouza avatar Dec 21 '22 12:12 aureosouza