title: React Native: Cannot read property 'push' of undefined - Have NavigatorIOS and ES6 bind(this)
body: <p>I am developing a react native application and I am attempting to route the user to the next view after successfully logging in through Facebook.</p>
  
  <p>The problem is that I continue to get an error stating "Cannot read property 'push' of undefined." I have checked all the related answers on the forum and I have made sure to include NavigatorIOS and bind(this) on my function call - so those are the issue.</p>
  
  <p>I would love assistance in determining what is wrong, as I am a novice dev. </p>
  
  <h1>Here is the error:</h1>
  
  <pre><code>Error: Cannot read property 'push' of undefined
   stack: 
    &lt;unknown&gt;                                              index.ios.bundle:1498
    MessageQueue.__invokeCallback                          index.ios.bundle:7235
    &lt;unknown&gt;                                              index.ios.bundle:7151
    guard                                                  index.ios.bundle:7104
    &lt;unknown&gt;                                              index.ios.bundle:7151
    &lt;unknown&gt;                                              index.ios.bundle:7148
    ReactDefaultBatchingStrategyTransaction.Mixin.perform  index.ios.bundle:6552
    Object.ReactDefaultBatchingStrategy.batchedUpdates     index.ios.bundle:15885
    Object.batchedUpdates                                  index.ios.bundle:5084
   URL: undefined
   line: undefined
   message: Cannot read property 'push' of undefined
  </code></pre>
  
  <p>============================</p>
  
  <h1>Here is my code</h1>
  
  <pre><code>'use strict';
  
  var React = require('react-native');
  var Main = require('./App/Components/Main');
  var Icon = require('./node_modules/react-native-vector-icons/FontAwesome');
  var FacebookLoginManager = require('NativeModules').FacebookLoginManager;
  var {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  TouchableHighlight,
  NavigatorIOS,
  Navigator,
  } = React;
  
  var styles = StyleSheet.create({
    container: {
      flex: 1,
      justifyContent: 'center',
      alignItems: 'center',
      backgroundColor: '#F5FCFF',
    },
   welcome: {
      fontSize: 20,
      textAlign: 'center',
      margin: 10,
    },
   instructions: {
      textAlign: 'center',
      color: '#333333',
      marginBottom: 5,
      marginTop: 10
   },
   icon: {
      fontSize: 20,
      color: 'white',
      paddingVertical: 5,
      paddingHorizontal: 8,
      borderRadius: 4,
      backgroundColor: '#3b5998',
   },
  text: {
      marginLeft: 10,
      color: 'white',
      fontWeight: '600',
  },
  });
  
  class nomsyapp extends React.Component {
    constructor(props) {
      super(props);
      this.state = {
        result: 'Find the Foods that Fit Your Lifestyle',
        loggedIn: false,
      };
    }
  
    login() {
      FacebookLoginManager.newSession((error, info) =&gt; {
        if (error) {
          this.setState({result: error});
        } else {
          this.setState({result: info});
          this.setState({loggedIn: true});
          this.props.navigator.push({
            component: Main,
            title: 'Choose Your Lifestyle',
          });
        }
      });
    }
  
    render() {
      return (
        &lt;View style={styles.container}&gt;
          &lt;TouchableHighlight onPress={this.login.bind(this)}&gt;
           &lt;Icon name="facebook" style={styles.icon}&gt;
              &lt;Text style={styles.text}&gt;Login with Facebook&lt;/Text&gt;
            &lt;/Icon&gt;
          &lt;/TouchableHighlight&gt;
          &lt;Text style={styles.instructions}&gt;
            {this.state.result}
          &lt;/Text&gt;
        &lt;/View&gt;
      );
    }
  };
  
  
  AppRegistry.registerComponent('nomsyapp', () =&gt; nomsyapp);
  </code></pre>
  
  <p>============================</p>