title: React Native :Button onPress not working
body: <p>Navigation not working on button press.This is my login page.I want to logout 
   from home screen to  login screen on onPressLogout()</p>
  
  <p><strong>index.js</strong></p>
  
  <pre><code>class Profile extends Component{
  static propTypes = {
      navigator: PropTypes.shape({
          getCurrentRoutes: PropTypes.func,
          jumpTo: PropTypes.func,
      }),
  }
  onPressLogout() {
      const routeStack = this.props.navigator.getCurrentRoutes();
      this.props.navigator.jumpTo(routeStack[0]);
  }
  render(){
    return (
           &lt;Container&gt;
               &lt;View style={styles.container}&gt;        
                 &lt;Header&gt;
                       &lt;Button 
                       style={styles.button}
                       onPress={() =&gt; this.onPressLogout()}
                       &gt;
                       &lt;Icon name="ios-power" /&gt;
                       &lt;/Button&gt;
                       &lt;Title&gt;Logout&lt;/Title&gt;
                 &lt;/Header&gt;
              &lt;/Container&gt;
   );
  }
  </code></pre>
  
  <p>and in routeStack</p>
  
  <pre><code>const routeStack = [
  { name: 'Login', component: Login},  
  ]
  </code></pre>