![](/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.