mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-12 09:21:09 +08:00
Update Screen-Nav-Options.md (#1211)
* Update Screen-Nav-Options.md * Apply some tweaks
This commit is contained in:
@@ -64,15 +64,18 @@ Imagine the following scenario:
|
||||
Your `TabNavigator` represents one of the screens in the app, and is nested within a top-level `StackNavigator`:
|
||||
|
||||
```
|
||||
StackNavigator:
|
||||
- route1: A screen
|
||||
- route2: A TabNavigator
|
||||
StackNavigator({
|
||||
route1: { screen: RouteOne },
|
||||
route2: { screen: MyTabNavigator },
|
||||
}, {
|
||||
headerMode: 'screen',
|
||||
});
|
||||
```
|
||||
|
||||
Now, when `route2` is active, you would like to hide the header. It's easy to hide the header for `route1`, and it should also be easy to do it for `route2`. This is what Default Navigation Options are for - they are simply `navigationOptions` set on a navigator:
|
||||
|
||||
```js
|
||||
TabNavigator({
|
||||
const MyTabNavigator = TabNavigator({
|
||||
profile: ProfileScreen,
|
||||
...
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user