react-navigation icon indicating copy to clipboard operation
react-navigation copied to clipboard

How to config custom DrawerNavigator DrawerItems with ScrollView

Open zhenliliu opened this issue 9 years ago • 5 comments

zhenliliu avatar Apr 22 '17 09:04 zhenliliu

import { DrawerNavigator, DrawerView } from 'react-navigation';

const contentComponent = (props) => (
    <ScrollView>
        <DrawerView.Items {...props} />
    </ScrollView>
);

const navigator = DrawerNavigator(routeConfig, {
    ...
    contentComponent,
    ...
});

Please don't forget to close this issue if this solution solves your problem.

nico1510 avatar Apr 26 '17 06:04 nico1510

Had the same problem, and your proposition fixed the issue.

The fact is the https://reactnavigation.org website is based upon the master branch, thus said to use DrawerItems, but this is due to #1219 which append after the latest beta release (beta.8).

Maybe it is just a matter of days before the 1.0 stable is released, but if not, and if it's easy to do, the website should use the latest release tag.

jdeniau avatar Apr 26 '17 11:04 jdeniau

Yes this is being discussed already https://github.com/react-community/react-navigation/issues/1060

nico1510 avatar Apr 26 '17 13:04 nico1510

Ok,thanks

zhenliliu avatar Apr 27 '17 01:04 zhenliliu

Check out https://medium.com/@kakul.gupta009/custom-drawer-using-react-navigation-80abbab489f7. Hoping it helps in figuring out how to customise the drawer navigator.

kakulgupta avatar Sep 24 '17 09:09 kakulgupta