title: Drawer menu not closing
body: <p>I created a drawer menu using the DrawerNavigation feature of react-navigation. I wanted to create a button that would close the menu but the onPress function seems to not work </p>
  
  <p>I've imported DrawerActions from 'react-navigation-drawer' and I've tried using different syntaxes </p>
  
  <p>ex.) this.props.navigation.dispatch(DrawerActions.closeDrawer());
       this.props.navigation.closeDrawer();</p>
  
  <pre><code>import React, { Component } from 'react';
  import {  
    Image, 
    StyleSheet, 
    Text, 
    ImageBackground, 
    TouchableWithoutFeedback, 
    View, 
    Button,
    ScrollView,
  } from 'react-native';
  import { 
    createDrawerNavigator,
    createStackNavigator, 
    createAppContainer,
    DrawerItems,
    SafeAreaView,
    NavigationActions
     } from 'react-navigation';
  
  import { DrawerActions, } from 'react-navigation-drawer';
  
  
  const navigator = createDrawerNavigator(
  {
    Home: Lander,
    Page1: Lander,
    Page2: Lander,
    Page3: Lander,
    Page4: Lander,
  },
  
  
  {
   contentComponent: (props) =&gt; (
       &lt;SafeAreaView&gt;
          &lt;View style= {{backgroundColor:'black'}}&gt;
              &lt;TouchableWithoutFeedback onPress={() =&gt; this.props.navigation.dispatch(DrawerActions.closeDrawer())}&gt;
                &lt;Image source={require('./Images/x.png')} style = {styles.cross}/&gt;
              &lt;/TouchableWithoutFeedback&gt;
          &lt;/View&gt; 
          &lt;ScrollView style= {{backgroundColor: 'black', paddingLeft: '5%'}}&gt;
                &lt;DrawerItems {...props} /&gt;
           &lt;/ScrollView&gt;
  
  
     &lt;/SafeAreaView&gt;
  
          )
      },
  
  
  
  
  
  
  );
  </code></pre>
  
  <p>I ultimately want to be able to click on the x button and let it redirect me to the home screen.</p>
  
  <p>I'm getting the following error</p>
  
  <blockquote>
    <p>Undefined is not an object (evaluating '_this.props.navigation')</p>
  </blockquote>