DrawerNavigator in React-navigation cannot navigate through the onPress pull-out drawer?

I try to use

in DrawerNavigator
<Button
    title="Drawer Open"
    onPress={() => {
        navigation.navigate("DrawerOpen")
    }}
/>

to call the button to exhale drawer navigation
but can not be called out on the Android simulator, can only slide out the navigation.
I have tried to change the onPress callback function to something else, such as alert, which works fine.
it"s okay to change the parameters in navigate to other components to jump directly, but there"s nothing you can do about DrawerOpen.
Thank you for your puzzles.


now the navigator installed through npm is v2. You can use the openDrawer () method to


step on pit + 1, and learn

Menu