mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-24 04:25:34 +08:00
add example for DrawerNavigatorConfig (#552)
* add example for DrawerNavigatorConfig * add explanation for the example
This commit is contained in:
@@ -91,6 +91,20 @@ The route configs object is a mapping from route name to a route config, which t
|
||||
- `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.
|
||||
|
||||
#### Example:
|
||||
|
||||
Default the `DrawerView` isn't scrollable.
|
||||
To achieve a scrollable `View`, you have to use the `contentComponent` to customize the container,
|
||||
as you can see in the example below.
|
||||
|
||||
```js
|
||||
{
|
||||
drawerWidth: 200,
|
||||
drawerPosition: 'right',
|
||||
contentComponent: props => <ScrollView><DrawerView.Items {...props} /></ScrollView>
|
||||
}
|
||||
```
|
||||
|
||||
Several options get passed to the underlying router to modify navigation logic:
|
||||
|
||||
- `initialRouteName` - The routeName for the initial route.
|
||||
|
||||
Reference in New Issue
Block a user