将道具传递给子标签组件

时间:2018-02-04 15:53:48

标签: reactjs react-native

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}/>

0 个答案:

没有答案