![](/img/trans.png)
[英]TypeError: undefined is not an object (evaluating '_reactNative.Animated.Text.propTypes.style')
[英]React Native TypeError: undefined is not an object (evaluating '_reactNative.Animated.Text.propTypes.style') in iOS simulator
这是我仅在此处使用 Animated.text 的代码。 它正在工作,但是当我安装 react-native-render-html 库之后,这个错误就来了。 但是,我已经卸载了该库,但仍然出现此错误。
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 上打开了关于此问题的问题
要解决这个问题:在 node_modules 中查找 'Animated.Text.propTypes.style' 并将其删除
(它存在于你的 node_module 的不同文件中)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.