mirror of
https://github.com/status-im/react-navigation.git
synced 2025-02-24 00:58:20 +00:00
Fix Stacks over Tabs example
This commit is contained in:
parent
d778479e4a
commit
1d2ce862c2
@ -94,6 +94,19 @@ const TabNav = createBottomTabNavigator(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
TabNav.navigationOptions = ({ navigation }) => {
|
||||||
|
let { routeName } = navigation.state.routes[navigation.state.index];
|
||||||
|
let title;
|
||||||
|
if (routeName === 'SettingsTab') {
|
||||||
|
title = 'Settings';
|
||||||
|
} else if (routeName === 'MainTab') {
|
||||||
|
title = 'Home';
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
title,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const StacksOverTabs = createStackNavigator({
|
const StacksOverTabs = createStackNavigator({
|
||||||
Root: {
|
Root: {
|
||||||
screen: TabNav,
|
screen: TabNav,
|
||||||
@ -107,9 +120,9 @@ const StacksOverTabs = createStackNavigator({
|
|||||||
Profile: {
|
Profile: {
|
||||||
screen: MyProfileScreen,
|
screen: MyProfileScreen,
|
||||||
path: '/people/:name',
|
path: '/people/:name',
|
||||||
navigationOptions: ({ navigation }) => {
|
navigationOptions: ({ navigation }) => ({
|
||||||
title: `${navigation.state.params.name}'s Profile!`;
|
title: `${navigation.state.params.name}'s Profile!`,
|
||||||
},
|
}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user