title: React Native: TypeError: undefined is not an object (evaluating 'this.props.navigation.navigate')
body: <p>Being a beginner in react-native, I can't figure out the problem in my code. By reading on the internet, I have an idea that I have some binding issue maybe.</p>
  
  <p>So, my code starts with index.js and registers the App component over there. The app component just contains the stack navigation routes. It load the LoginScreen component (displays logo, background and name of the application) which in turn loads LoginForm component. There is no authentication on the Login button and the only thing I need is that the Menu component is loaded as I press the Login button. It is giving the TypeError: undefined is not an object (evaluating 'this.props.navigation.navigate')</p>
  
  <p>index.js</p>
  
  <pre><code>import { AppRegistry } from 'react-native';
  import App from './App';    
  
  AppRegistry.registerComponent('bluebulk', () =&gt; App);
  </code></pre>
  
  <p>App.js</p>
  
  <pre><code>import { StackNavigator } from 'react-navigation';
  import LoginScreen from './src/components/login/LoginScreen';
  import Menu from './src/components/menu/Menu';
  
    const App = StackNavigator({
    Main: { screen: LoginScreen },
    Menu: { screen: Menu }
  });
  
  export default App;
  </code></pre>
  
  <p>LoginScreen.js</p>
  
  <pre><code>import { StackNavigator } from 'react-navigation';
  import React, { Component } from 'react';
  import { StyleSheet, View, Text, Image } from 'react-native';
  import LoginForm from './LoginForm';
  
  class LoginScreen extends Component {
  
  render() {
      return (
  
          &lt;View style={styles.container}&gt;
              &lt;View style={styles.logoContainer}&gt;
                  &lt;Image
                      style={styles.logo}
                      source={require('../../images/transparent.png')}
                  /&gt;
                  &lt;View style={{ flexDirection: 'row' }}&gt;
                      &lt;Text style={styles.blueTextStyle}&gt;Blue&lt;/Text&gt;
                      &lt;Text style={styles.bulkTextStyle}&gt;Bulk&lt;/Text&gt;
                  &lt;/View&gt;
              &lt;/View&gt;
              &lt;View style={styles.formContainer}&gt;
                  &lt;LoginForm /&gt;
              &lt;/View&gt;
          &lt;/View&gt;
  
  
          );
  }
  }
  
  
  export default LoginScreen;
  </code></pre>
  
  <p>LoginForm.js</p>
  
  <pre><code>import React, { Component } from 'react';
  import {
  StyleSheet,
  TextInput,
  TouchableOpacity,
  Text,
  View,
  KeyboardAvoidingView,
  Keyboard
  } from 'react-native';
  import { StackNavigator } from 'react-navigation';
  
  class LoginForm extends Component {
  
  render() {
      return (
  
          &lt;KeyboardAvoidingView behavior='height' style={styles.container}&gt;
  
              &lt;View style={{ flexDirection: 'row' }}&gt;
                  &lt;Text style={styles.textStyle}&gt;Email:&lt;/Text&gt;
                  &lt;TextInput
                      style={styles.styleInput}
                      placeholder="user@gmail.com"
                      returnKeyType="next"
                      keyboardType="email-address"
                      onSubmitEditing={() =&gt; this.refs.password.focus()}
                  /&gt;
              &lt;/View&gt;
  
          &lt;View style={{ flexDirection: 'row' }}&gt;
              &lt;Text style={styles.textStyle}&gt;Password:&lt;/Text&gt;
              &lt;TextInput
                  ref='password'
                  style={styles.styleInput}
                  placeholder="password"
                  secureTextEntry
                  returnKeyType="go"
                  onSubmitEditing={Keyboard.dismiss}
              /&gt;
          &lt;/View&gt;
  
              &lt;TouchableOpacity
              style={styles.buttonContainer}
              onPress={() =&gt; this.props.navigation.navigate('Menu')} //Error here
              &gt;
                  &lt;Text style={styles.buttonText}&gt;Login&lt;/Text&gt;
              &lt;/TouchableOpacity&gt;
          &lt;/KeyboardAvoidingView&gt;
  
          );
  }
  }
  
  export default LoginForm;
  </code></pre>
  
  <p>Menu.js</p>
  
  <pre><code>import React, { Component } from 'react';
  import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
  import { StackNavigator } from 'react-navigation';
  
  class Menu extends Component {
  
  render() {
      const { navigate } = this.props.navigation;
      return (
          &lt;View style={styles.container}&gt;
              &lt;View style={styles.viewContainer}&gt;
  
                  &lt;TouchableOpacity style={styles.buttonContainer}&gt;
                      &lt;Text style={styles.buttonText}&gt;View Products&lt;/Text&gt;
                  &lt;/TouchableOpacity&gt;
  
                  &lt;TouchableOpacity style={styles.buttonContainer}&gt;
                      &lt;Text style={styles.buttonText}&gt;View Discounts/Offers&lt;/Text&gt;
                  &lt;/TouchableOpacity&gt;
  
                  &lt;TouchableOpacity style={styles.buttonContainer}&gt;
                      &lt;Text style={styles.buttonText}&gt;View Invoice History&lt;/Text&gt;
                  &lt;/TouchableOpacity&gt;
  
              &lt;/View&gt;
  
          &lt;/View&gt;
          );
  }
  }
  
  
  
  export default Menu;
  </code></pre>