Passing values to a method by triggering onPress in React Native
<pre><code>var Restaurant = React.createClass({
resPress: function (resId, resName) {
    this.props.navigator.push({
        name: 'viewMenu',
        id: resId,
        placeName: resName
    });
},
render: function () {
    var that = this;
    return (
            &lt;View&gt;
                {this.state.place.map((item, i) =&gt; (&lt;TouchableOpacity key={i} onPress={() =&gt; this.resPress(item.res_id, item.res_name)} &gt;&lt;Text&gt;{item.res_name}&lt;/Text&gt;&lt;/TouchableOpacity&gt;))}
            &lt;/View&gt;
    )
}
});
</code></pre>

<p>This works perfectly fine. My question is why cant I just pass the values to the 'resPress' like mentioned below?</p>

<pre><code>onPress={this.resPress(item.delivery_id, item.place_name)}
</code></pre>