title: Can't find variable: navigate
body: <p>I am trying to navigate between two screen with the help of <code>react-navigation</code>. I am able to access <code>navigate</code> inside the <code>render</code> method as its scope is also inside that method. </p>
  
  <p>Where should I declare so I can access it any method of this <code>component</code>. I am trying to access <code>navigate</code> inside the <code>onPressButton</code> method but it giving an error.</p>
  
  <blockquote>
    <p>Can't find variable: navigate</p>
  </blockquote>
  
  <pre><code>import React, { Component } from "react";
  import { View, Text, Image, Button, Alert, StyleSheet } from "react-native";
  import styles from "./Styles";
  import * as strings from "./Strings";
  import RoundButton from "./RoundButton";
  var DialogAndroid = require("react-native-dialogs");
  import { StackNavigator } from "react-navigation";
  
  export default class CreateMessageScreen extends Component {
    render() {  
      const { navigate } = this.props.navigation;
  
      return (
        &lt;View style={styles.container}&gt;
          &lt;Image source={require("./img/create_message.png")} /&gt;
          &lt;Text style={styles.textStyle}&gt;{strings.create_message}&lt;/Text&gt;
  
          &lt;RoundButton
            textStyle={styles.roundTextStyle}
            buttonStyle={styles.roundButtonStyle}
            onPress={this.onPressButton}
          &gt;
            CREATE MESSAGE
          &lt;/RoundButton&gt;
  
        &lt;/View&gt;
      );
    }
  
    onPressButton() {
      var options = {
        title: strings.app_name,
        content: strings.create_message,
        positiveText: strings.OK,
        onPositive: () =&gt; navigate("DashboardScreen")
      };
      var dialog = new DialogAndroid();
      dialog.set(options);
      dialog.show();
    }
  }
  </code></pre>