title: onPress event in navigationOptions property
body: <p>I'm trying to create a menu button in the header area of one of my screens.</p>
  
  <p>However, I can't figure out how to get the onPress navigation to work.</p>
  
  <p>Obviously, the code below will produce an error because navigate is defined after it's first used.</p>
  
  <p>But, when I try to move the const { navigate } declaration up before I set the navigationOptions property, I get an "unexpected token" error in my IDE (visual studio code).</p>
  
  <p>Is there any way around this?</p>
  
  <p>Thanks!</p>
  
  <pre><code>export default class HomeScreen extends React.Component
   {
      constructor(props) {
      super(props); 
  }
      static navigationOptions = {
          title: 'Seekers',
              headerRight: 
                  &lt;TouchableHighlight onPress={ () =&gt; navigate('Menu', { 
                      menu: options
                  })}&gt;
                      &lt;Image source={require('./images/menu.png')} style={{width: 50, height: 50}} /&gt;
                  &lt;/TouchableHighlight&gt;,
  };
  
  render() {
  
      const { navigate } = this.props.navigation;
      return (
              &lt;View&gt;
              ... more view stuff...
  </code></pre>