title: React Native Navigator set title dynamically iOS
body: <pre><code>var MainPage = React.createClass({
     onPress() {
      this.props.navigator.push({
          title: 'Home Page',
          component: Homepage
      });
  },
  
  render() {
      return (
          &lt;View style={[styles.scene, {backgroundColor: '#DAF6FF'}]}&gt;
              &lt;TouchableHighlight
                style={styles.menubutton}
                onPress={this.onPress}&gt;
                  &lt;Text style={styles.white}&gt;This page&lt;/Text&gt;
              &lt;/TouchableHighlight&gt;
              &lt;TouchableHighlight
                style={styles.menubutton}
                onPress={this.onPress}&gt;
                  &lt;Text style={styles.white}&gt;That page&lt;/Text&gt;
              &lt;/TouchableHighlight&gt;
              &lt;TouchableHighlight
                style={styles.menubutton}
                onPress={this.onPress}&gt;
                  &lt;Text style={styles.white}&gt;Another page&lt;/Text&gt;
              &lt;/TouchableHighlight&gt;
          &lt;/View&gt;
      );
    }
  });
  </code></pre>
  
  <p>How can I send a variable with this.onPress to set the navigator title dynamically? ie if I press 'This page' it would set the title to 'This page' in the onPress function. Also it would be useful to set the component dynamically.</p>
  
  <p>Other than creating separate functions for every menu item there doesn't seem to be any obvious way to achieve this. I've tried various things and searched to no avail.</p>