React Native: Exception thrown while executing UI block

后端 未结 3 1374
春和景丽
春和景丽 2021-02-18 18:48

I\'m building an iOS react-native app, and I\'m currently using the react-native-swipe-card package to build \"tinder\" like swipe cards for my app. The app works fine however w

相关标签:
3条回答
  • 2021-02-18 19:42

    As @Peuchele commented, I was getting this same error, and the reason it was happening was because I passed a value into an Animated View that was undefined.

    So, to clarify, make sure any values you pass into a component using an Animated.Value is not undefined.

    The specific code I found at fault was:

    const { value } = props;
    
    this.state = {
      translateYValue: new Animated.Value(value),
    };
    

    And props.value was undefined.

    0 讨论(0)
  • 2021-02-18 19:42

    Or make sure the value being passed is not NAN

    0 讨论(0)
  • 2021-02-18 19:51

    You may have to add @objc above the block in native code where you define the property.

    0 讨论(0)
提交回复
热议问题