title: In React-Native, trying to access the drawer open from stack navigator in header back button
body: <p>I am new to react native, I want to access my home page drawer open from stack navigation which is in launch.js</p>
  <blockquote>
  <p>launch.js</p>
  </blockquote>
  <pre><code>import * as React from 'react';
  import {Button, View} from 'react-native';
  import {createDrawerNavigator} from '@react-navigation/drawer';
  import {NavigationContainer} from '@react-navigation/native';
  import {createStackNavigator} from '@react-navigation/stack';
  import {Home, Login} from './screens';
  
  const Drawer = createDrawerNavigator();
  const AuthStack = createStackNavigator();
  const LoginStack = createStackNavigator();
  const HomeStack = createStackNavigator();
  
  const LoginUI = ({navigation}) =&gt; {
    return (
      &lt;LoginStack.Navigator&gt;
        &lt;LoginStack.Screen name=&quot;login&quot; component={Login}&gt;&lt;/LoginStack.Screen&gt;
      &lt;/LoginStack.Navigator&gt;
    );
  };
  
  const HomeUI = ({navigation}) =&gt; {
    const closeDraw = () =&gt; {
      navigation.openDrawer();
    };
    return (
      &lt;Drawer.Navigator initialRouteName=&quot;home&quot;&gt;
        &lt;Drawer.Screen name=&quot;home&quot; component={Home} /&gt;
      &lt;/Drawer.Navigator&gt;
    );
  };
  
  export default function App() {
    return (
      &lt;NavigationContainer&gt;
        &lt;AuthStack.Navigator&gt;
          &lt;AuthStack.Screen name=&quot;login&quot; component={LoginUI}&gt;&lt;/AuthStack.Screen&gt;
          &lt;AuthStack.Screen
            name=&quot;home&quot;
            component={HomeUI}
            options={{
              headerLeft: () =&gt; (
                &lt;Button
                  title=&quot;ham&quot;
                  onPress={() =&gt; {
                    navigation.openDrawer();
                  }}&gt;&lt;/Button&gt;
              ),
            }}&gt;&lt;/AuthStack.Screen&gt;
        &lt;/AuthStack.Navigator&gt;
      &lt;/NavigationContainer&gt;
    );
  }
  </code></pre>
  <blockquote>
  <p>screens.js</p>
  </blockquote>
  <pre><code>import * as React from 'react';
  import {Button, View} from 'react-native';
  
  export const Home = ({navigation}) =&gt; {
    return (
      &lt;View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}&gt;
        &lt;Button onPress={() =&gt; navigation.goBack()} title=&quot;Logout&quot; /&gt;
      &lt;/View&gt;
    );
  };
  
  export const Login = ({navigation}) =&gt; {
    return (
      &lt;View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}&gt;
        &lt;Button onPress={() =&gt; navigation.navigate('home')} title=&quot;Login&quot; /&gt;
      &lt;/View&gt;
    );
  };
  </code></pre>
  <p>I am facing following error message.</p>
  <blockquote>
  <p>Error</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/DjwC5.jpg" rel="nofollow noreferrer">Error I am facing</a></p>
  <p>I tried with this.props.navigation.openDrawer() that also not helped me, please help on this.</p>
  <p>Thank you.</p>