Skip to content

Commit 9590c24

Browse files
committed
react-navigation#186 add a section to explain the use case
1 parent ba8b290 commit 9590c24

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

docs/bottom-tab-navigator.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The route configs object is a mapping from route name to a route config.
2020
* `order` - Array of routeNames which defines the order of the tabs.
2121
* `paths` - Provide a mapping of routeName to path config, which overrides the paths set in the routeConfigs.
2222
* `backBehavior` - Should the back button cause a tab switch to the initial tab? If yes, set to `initialRoute`, otherwise `none`. Defaults to `initialRoute` behavior.
23-
* `tabBarComponent` - Optional, override component to use as the tab bar. You need to import `BottomTabBar` from `react-navigation-tabs` in order to receive the passing `props`.
23+
* `tabBarComponent` - Optional, override component to use as the tab bar.
2424
* `tabBarOptions` - An object with the following properties:
2525
* `activeTintColor` - Label and icon color of the active tab.
2626
* `activeBackgroundColor` - Background color of the active tab.
@@ -47,6 +47,25 @@ tabBarOptions: {
4747
}
4848
```
4949

50+
If you want to customize the `tabBarComponent`:
51+
52+
```js
53+
import { createBottomTabNavigator, BottomTabBar } from 'react-navigation-tabs';
54+
55+
const TabBarComponent = (props) => (<BottomTabBar {...props} />);
56+
57+
const TabScreens = createBottomTabNavigator(
58+
{
59+
tabBarComponent: props =>
60+
<TabBarComponent
61+
{...props}
62+
style={{ borderTopColor: '#605F60' }}
63+
/>,
64+
},
65+
);
66+
```
67+
68+
5069
## `navigationOptions` for screens inside of the navigator
5170

5271
#### `title`

0 commit comments

Comments
 (0)