TabNavigator如何接受上个页面传过来的参数。



  • 上个页面是有传参数过来的
    const resetAction = NavigationActions.reset({
    index: 0,
    actions: [
    NavigationActions.navigate({routeName: 'Home', params: {theme: this.state.theme}})
    ]
    })
    this.props.navigation.dispatch(resetAction)

    下个页面的代码如下:
    export default HomeScene = TabNavigator(
    {
    MessageIndexScene: {
    screen: MessageIndexScene,
    navigationOptions: ({navigation}) => ({
    tabBarLabel: '消息',
    tabBarIcon: ({focused, tintColor}) => (
    <TabBarItem
    tintColor={tintColor}
    focused={focused}
    badgeText='4'
    normalImage={require('../Image/message_c.png')}
    selectedImage={require('../Image/message_o.png')}
    />
    )
    }),
    },
    ……
    TabNavigator如何接受上个页面传过来的参数。


登录后回复