React Native TypeError:iOS模拟器中未定义的对象不是对象(评估'_reactNative.Animated.Text.propTypes.style') [英] React Native TypeError: undefined is not an object (evaluating '_reactNative.Animated.Text.propTypes.style') in iOS simulator

查看:59
本文介绍了React Native TypeError:iOS模拟器中未定义的对象不是对象(评估'_reactNative.Animated.Text.propTypes.style')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我仅在此处使用Animated.text的代码.它正在工作,但是当我安装了react-native-render-html库之后,出现此错误.但是,我已经卸载了该库,但是仍然出现此错误.

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>
);

错误图片

推荐答案

有关此问题的问题已在github上打开

An issue Concerning this problem is opened on github

NativeBase/issues/3109

要解决此问题:在node_modules中查找"Animated.Text.propTypes.style"并将其删除

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

(它存在于您的node_module的不同文件中)

( It exists in deferent files on your node_module )

这篇关于React Native TypeError:iOS模拟器中未定义的对象不是对象(评估'_reactNative.Animated.Text.propTypes.style')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆