React-native-interactable: Bad mapping for type undefined for key x

Created on 23 Jul 2020  路  3Comments  路  Source: wix/react-native-interactable

Hi guys!
react-native-interactable has a problem with react-native version 0.63
I'm getting this error if I try to use animatedValueY or animatedValueX
image
image

I found that if I send both animatedValueY and animatedValueX values this error doesn't happen, so this is a quick fix, but if I send only one of these values, the error happens.

Thank you!

Most helpful comment

I experienced the same as @dmitryusikriseapps. I was using only animatedValueX. When adding any value for animatedValueY I got rid of the exception, but my animation did not work properly until I added its own Animated.Value like this const deltaY = useRef(new Animated.Value(0)).current;

To summerize:

  const deltaX = useRef(new Animated.Value(0)).current;
  const deltaY = useRef(new Animated.Value(0)).current;

        <Interactable.View
          ...
          animatedValueX={deltaX}
          animatedValueY={deltaY}
         ...

All 3 comments

I experienced the same as @dmitryusikriseapps. I was using only animatedValueX. When adding any value for animatedValueY I got rid of the exception, but my animation did not work properly until I added its own Animated.Value like this const deltaY = useRef(new Animated.Value(0)).current;

To summerize:

  const deltaX = useRef(new Animated.Value(0)).current;
  const deltaY = useRef(new Animated.Value(0)).current;

        <Interactable.View
          ...
          animatedValueX={deltaX}
          animatedValueY={deltaY}
         ...

Thank you. Also fixed for me to add the missing animatedValueX to the existing animatedValueY.

Thank you so much. In my case, I just use animatedValueY, added animatedValueX and it resolve the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arqex picture arqex  路  3Comments

m10653 picture m10653  路  4Comments

portons picture portons  路  7Comments

brentvatne picture brentvatne  路  6Comments

BogdanRad picture BogdanRad  路  4Comments