title: recieving an error 'undefined is not an object evaluating this.props.navigation' while trying to navigate to another screen
body: <p>returning this error while tying to navigate using switchnavigation.</p>
  
  <p>i have tried removing this. props then returns undefined 'navigation'.</p>
  
  <pre><code>import React from 'react';
  import { Text, View, Image, TouchableOpacity } from 'react-native';
  import Icon from 'react-native-vector-icons/Ionicons';
  import { createSwitchNavigator, createAppContainer , withNavigation } from 'react-navigation';
  import {widthPercentageToDP as wp, heightPercentageToDP as hp} from 'react-native-responsive-screen';
  import layout from '../../constants/LayoutStyle'
  import QuoteScreen from './QuoteScreen';
  
   const HomeScreen = () =&gt; {
  
   return (
             &lt;View style={styles.viewStyles}&gt;
             &lt;View style={{position: 'absolute',top: hp('50%')+wp('37.5%'),left:wp('15%'),width: wp('32.5%'),height: 
        wp('32.5%'),backgroundColor:'rgba(255,255,255,0.1)'}}&gt;
              &lt;View style={{alignItems: 'center',justifyContent: 'center',flex:1}}&gt;
              &lt;Icon name="ios-book" color="purple" size={wp('10%')}
                onPress={() =&gt; this.props.navigation.navigate('Quote')}
                /&gt;
              &lt;Text style={styles.tabTextStyle}&gt;Books&lt;/Text&gt;
              &lt;/View&gt;
    &lt;/View&gt;
  
      );
   };
  
   const RootStack = createSwitchNavigator(
    {
       Home: HomeScreen,
       Quote: QuoteScreen,
     }
   );
  
    const AppContainer = createAppContainer(RootStack);
  
    export default class app extends React.Component {
      render() {
        return &lt;AppContainer /&gt;
      }
    }
  </code></pre>
  
  <p>expected to complete navigation properly</p>