enter image description here我试着将this.props.navigation传递给另一个选项卡,但它返回null,我需要使用scrollabletabbarview和react-navigation / stacknavigator组件。我想点击标签内部并打开一个新的堆栈
render() {
const { navigate } = this.props.navigation;
return <ScrollableTabView style={{backgroundColor:'yellow',padding:0}}
tabBarActiveTextColor="#333"
tabBarBackgroundColor="yellow"
tabStyle={{ paddingTop: 0 }}
navigator={this.props.navigation}
contentProps={this.props}
renderTabBar={() => <TabBar underlineColor="#333" tabBadgeColor="#333333"/>}>
<Pagehg tabLabel={{label: "dsadsa!"}} label="Hoşgeldin!"/>
<Chats tabLabel={{label: "dsa dsa", badge: 3,props:navigate}} label="Page #2 aka Long!" navigation={navigate}/>