title: ReactNative Navigation headerRight Toggle Drawer Error
body: <p>I have a screen where i have a back button and a menu drawer button on the right </p>
  
  <p>when i click on the menu drawer button i get the error (undefined isn't an object) </p>
  
  <p>the code tried to trigger the toggle.drawer(). it works fine in the render code but it doesn't work in the headerRight here is the code </p>
  
  <pre><code>    export default class categoryScreen extends React.Component {
      static navigationOptions = {
          headerRight:
          &lt;Button 
          onPress={()=&gt; this.props.navigation.toggleDrawer()} // This Doesn't work how to make it work
          transparent&gt;
              &lt;Icon style={styles.categoryDrawerMenu}type="Entypo" ios='ios-menu' android="menu" color="#1a1917" /&gt;
          &lt;/Button&gt;,
        drawerIcon: (
          &lt;Icon style={styles.menu}type="AntDesign" name="home" color="#1a1917" /&gt;
        )
      }
      render() {
            return (                                                                                                           
              &lt;Container&gt;
                          &lt;Button 
          onPress={()=&gt; this.props.navigation.toggleDrawer()} // This Works 
          transparent&gt;
              &lt;Icon style={styles.categoryDrawerMenu}type="Entypo" ios='ios-menu' android="menu" color="#1a1917" /&gt;
          &lt;/Button&gt;
              &lt;/Container&gt;
           );                                                                                                                 
        }
  }
  </code></pre>