Update documentation regarding DrawerNavigator customisation (#646)

* Update documentation regarding `DrawerNavigator` customisation

* Updated docs as requested in the PR.
This commit is contained in:
Cai Leao 2017-03-22 19:09:10 +00:00 committed by Eric Vicenti
parent 0f19a0bddf
commit 498f329005

View File

@ -88,7 +88,7 @@ The route configs object is a mapping from route name to a route config, which t
- `drawerWidth` - Width of the drawer
- `drawerPosition` - Options are `left` or `right`. Default is `left` position.
- `contentComponent` - Component to use to render the navigation items. Receives the `navigation` prop for the drawer. Defaults to `DrawerView.Items`.
- `contentComponent` - Component used to render the content of the drawer, for example, navigation items. Receives the `navigation` prop for the drawer. Defaults to `DrawerView.Items`. For more information, see below.
- `contentOptions` - Configure the drawer content, see below.
Several options get passed to the underlying router to modify navigation logic:
@ -98,6 +98,24 @@ Several options get passed to the underlying router to modify navigation logic:
- `paths` - Provide a mapping of routeName to path config, which overrides the paths set in the routeConfigs.
- `backBehavior` - Should the back button cause switch to the initial route? If yes, set to `initialRoute`, otherwise `none`. Defaults to `initialRoute` behavior.
### Providing a custom `contentComponent`
You can easily override the default component used by `react-navigation`:
```js
const CustomDrawerContentComponent = (props) => (
<View style={style.container}>
<DrawerView.Items {...props} />
</View>
);
const styles = StyleSheet.create({
container : {
flex : 1,
},
});
```
### `contentOptions` for `DrawerView.Items`
- `activeTintColor` - label and icon color of the active label