title: react-navigation withNavigation returns undefined
body: <p>In my react-native app, I have a component for my header with back button. It works except for when I click the back button and it gives me this error: <strong>undefined is not an object (evaluating this.props.navigation)</strong></p>
  
  <p>So I followed the docs <a href="https://reactnavigation.org/docs/en/connecting-navigation-prop.html" rel="nofollow noreferrer">here</a> and tried using <code>withNavigation</code>. But I still get the same error. What am I doing wrong?</p>
  
  <pre><code>import React from 'react'
  import { StyleSheet, Text, View, TouchableOpacity } from 'react-native'
  import { withNavigation } from 'react-navigation';
  
  const HeaderWithBackBtn = (props) =&gt; {
      return (
          &lt;View style={styles.container}&gt;
              {/* Back button */}
              &lt;TouchableOpacity 
                  style={{width: 100}} 
                  onPress={() =&gt; this.props.navigation.goBack()}&gt;
                  &lt;Text style={styles.backBtn}&gt;Back&lt;/Text&gt;
              &lt;/TouchableOpacity&gt;
  
              &lt;Text style={styles.text}&gt; {props.screen} &lt;/Text&gt;
  
              {/* Placeholder button */}
              &lt;Text style={{width: 100}}&gt;&lt;/Text&gt;
          &lt;/View&gt;
      )
  }
  
  const styles = StyleSheet.create({
      ...
  });
  
  export default withNavigation(HeaderWithBackBtn);
  </code></pre>