mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 22:39:41 +08:00
fixed initialRouteName documentation (#121)
https://github.com/react-community/react-navigation/issues/119
This commit is contained in:
@@ -84,10 +84,10 @@ const MyApp = TabNavigator({
|
||||
|
||||
Several options get passed to the underlying router to modify navigation logic:
|
||||
|
||||
- `initialTab` - The routeName for the initial tab route when first loading
|
||||
- `initialRouteName` - The routeName for the initial tab route when first loading
|
||||
- `order` - Array of routeNames which defines the order of the tabs
|
||||
- `paths` - Provide a mapping of routeName to path config, which overrides the paths set in the routeConfigs.
|
||||
- `backBehavior` - Should the back button cause a tab switch to the initial tab? If yes, set to `initialTab`, otherwise `none`. Defaults to `initialTab` behavior.
|
||||
- `backBehavior` - Should the back button cause a tab switch to the initial tab? If yes, set to `initialRoute`, otherwise `none`. Defaults to `initialRoute` behavior.
|
||||
|
||||
### `tabBarOptions` for `TabBarBottom` (default tab bar on iOS)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ const MyApp = TabRouter({
|
||||
Home: { screen: HomeScreen },
|
||||
Settings: { screen: SettingsScreen },
|
||||
}, {
|
||||
initialTab: 'Home',
|
||||
initialRouteName: 'Home',
|
||||
})
|
||||
```
|
||||
|
||||
@@ -46,10 +46,10 @@ Each item in the config may have the following:
|
||||
|
||||
Config options that are also passed to the router.
|
||||
|
||||
- `initialTab` - The routeName for the initial tab route when first loading
|
||||
- `initialRouteName` - The routeName for the initial tab route when first loading
|
||||
- `order` - Array of routeNames which defines the order of the tabs
|
||||
- `paths` - Provide a mapping of routeName to path config, which overrides the paths set in the routeConfigs.
|
||||
- `backBehavior` - Should the back button cause a tab switch to the initial tab? If yes, set to `initialTab`, otherwise `none`. Defaults to `initialTab` behavior.
|
||||
- `backBehavior` - Should the back button cause a tab switch to the initial tab? If yes, set to `initialRoute`, otherwise `none`. Defaults to `initialRoute` behavior.
|
||||
|
||||
### Supported Actions
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ const CustomTabRouter = TabRouter({
|
||||
},
|
||||
}, {
|
||||
// Change this to start on a different tab
|
||||
initialTab: 'Home',
|
||||
initialRouteName: 'Home',
|
||||
});
|
||||
|
||||
const CustomTabs = createNavigationContainer(createNavigator(CustomTabRouter)(CustomTabView));
|
||||
|
||||
Reference in New Issue
Block a user