const CategoriesStack = StackNavigator({
Category: {
screen: CategoryScreen,
navigationOptions: () => ({
tabBarVisible: true,
header: null
}),
},
Product: {
screen: ProductScreen,
navigationOptions: () => ({
tabBarVisible: false
}),
}
},
{
initialRouteName: 'Category',
navigationOptions: {
headerTitleStyle: {
fontWeight: 'normal',
}
}
});
...
const HomeStack = StackNavigator({
Home: {
screen: HomeScreen,
navigationOptions: () => ({
tabBarVisible: true,
header: null
}),
},
Search: {
screen: SearchScreen,
navigationOptions: () => ({
tabBarVisible: false,
header : null
}),
}
},
{
initialRouteName: 'Home',
navigationOptions: {
headerTitleStyle: {
fontWeight: 'normal',
}
}
});
因此,我在Tab导航器中绑定了两个Stack导航器。从HomeStack-> HomeScreen,我需要将数据传递到CategoriesStack->初始路由名称。我找不到办法。
我不知道该怎么做。