title: undefined is not an object (evaluating _this2.props.navigation.navigate)
body: <p>I'm working with react-native and I'm facing a problem with navigators.</p>
  
  <p>The code:</p>
  
  <p>App.js</p>
  
  <pre><code>import React, {Component} from 'react';
  import {
     AppRegistry,
     StyleSheet,
     Text,
     View,
  } from 'react-native';
  
  import { StackNavigator } from 'react-navigation';
  
  import loginScreen from './src/components/loginView';
  import registerScreen from './src/components/registerView';
  
  const Appmemes = StackNavigator({
     Login: {screen: loginScreen},
     Register: {screen: registerScreen}
  });
  
  export default Appmemes;
  
  AppRegistry.registerComponent('Appmemes', () =&gt; Appmemes);
  </code></pre>
  
  <p>loginView.js works correctly:</p>
  
  <pre><code>.
  .
  .
    &lt;View style={styles.formContainer}&gt;
            &lt;LoginForm/&gt;
    &lt;/View&gt;
  .
  .
  .    
  </code></pre>
  
  <p>LoginForm.js</p>
  
  <pre><code>import React, { Component } from 'react'
  import { StyleSheet, TextInput, Text, View, TouchableOpacity, AppRegistry} from 'react-native'
  import { StackNavigator} from 'react-navigation';
  
  export default class LoginForm extends Component{
    render() {
        return(
        &lt;View style={styles.container}&gt;
  
            &lt;TouchableOpacity style={styles.buttonContainer1}&gt;
              &lt;Text style={styles.buttonText}&gt;Entrar&lt;/Text&gt;
            &lt;/TouchableOpacity&gt;
  
            &lt;TouchableOpacity style={styles.buttonContainer2} onPress={() =&gt; this.props.navigation.navigate('Login')}&gt;
  
              &lt;Text style={styles.buttonText}&gt;Registrarse&lt;/Text&gt;
            &lt;/TouchableOpacity&gt;
        &lt;/View&gt;
      );
    }
  }
  
  AppRegistry.registerComponent('LoginForm', () =&gt; LoginForm);
  
  const styles = StyleSheet.create({...]);
  });
  </code></pre>
  
  <p>The error is: </p>
  
  <blockquote>
    <p>undefined is not an object (evaluating _this2.props.navigation.navigate)</p>
  </blockquote>
  
  <p>The error is in <code>OnPress()</code> in LoginForm.js </p>
  
  <pre><code>onPress={() =&gt; this.props.navigation.navigate('Login')
  </code></pre>
  
  <p>What could be the cause for this error?</p>