React Native TypeError: undefined is not an object (evaluating '_reactNative.Animated.Text.propTypes.style') in iOS simulator

≡放荡痞女 提交于 2021-02-11 14:15:22

问题


This is the code where I use Animated.text only here. It was working but when I installed react-native-render-html library after that this error comes. However, I have uninstalled that library but still this error comes.

return (
  <View style={styles.tabBar}>
    {props.navigationState.routes.map((route, i) => {
      const color = Animated.color(
        Animated.round(
          Animated.interpolate(props.position, {
            inputRange,
            outputRange: inputRange.map(inputIndex =>
              inputIndex === i ? 255 : 0
            ),
          })
        ),
        0,
        0
      );

      return (
        <TouchableOpacity
          style={styles.tabItem}
          onPress={() => this.setState({ index: i })}>
          <Animated.Text style={{ color }}>{route.title}</Animated.Text>
        </TouchableOpacity>
      );
    })}
  </View>
);

Error Image


回答1:


An issue Concerning this problem is opened on github

NativeBase/issues/3109

To solve this: Look for 'Animated.Text.propTypes.style' in node_modules and delete it

( It exists in deferent files on your node_module )



来源:https://stackoverflow.com/questions/61201873/react-native-typeerror-undefined-is-not-an-object-evaluating-reactnative-ani

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!