我在 react native 中使用 TabBarIOS,并在 android 模拟器上运行它,但是在使用 TabBarIOS.Item 时出现以下错误Element type is invalid expected a string(for built in components) or a class/function (for composite functions) but got undefined check render method of Approvals
Approvals的render()方法如下
render(){
return (
<View style={styles.container}>
<View style={styles.strip}>
<Image style={{width:50, height:30,padding:10,top:5}} source={require('./drawable/drawable/asap.png')}/>
<Text style={{fontSize:20,color:'white',bottom:20,left:60,padding:10}}>Approvals</Text>
</View>
<TabBarIOS selectedTab={this.state.selectedTab}>
<TabBarIOS.Item
title="Pending"
icon={{uri:'./drawable/drawable/approvalbadge.png',scale:3}}
selected={this.state.selectedTab==='pending'}
onPress={() => {
this.setState({
selectedTab: 'pending',
});
}}>
<Pending>
</TabBarIOS.Item>
</TabBarIOS>
</View>
);
}
仅当我删除 TabBarIOS 并将其放置不给出任何错误时,此部分中的错误才会导致。请帮我解决这个问题。