Reactjs 将道具传递给子选项卡组件
我试图将this.props.navigation传递到另一个选项卡,但它返回null,我需要使用scrollabletabbarview和react navigation/stacknavigator组件。我想点击“内部”选项卡并打开一个新堆栈Reactjs 将道具传递给子选项卡组件,reactjs,react-native,Reactjs,React Native,我试图将this.props.navigation传递到另一个选项卡,但它返回null,我需要使用scrollabletabbarview和react navigation/stacknavigator组件。我想点击“内部”选项卡并打开一个新堆栈 render() { const { navigate } = this.props.navigation; return <ScrollableTabView style={{bac
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}/>
render(){
const{navigate}=this.props.navigation;
返回}>
您正在使用react导航吗?@vijayst是。。。“it returns null”表示什么返回null?其中?@Code peedient已更新错误类型错误:undefined不是对象(评估'this.props.navigation.navigate')