title: Passing values to functions in React Native from Array
body: <p>I am extracting data from a JSON Array and creating objects out of it and setting the string values that I need from the array within the objects I am creating using a <code>for</code> loop: </p>
  
  <pre><code>var gamesList = [];
  gamesList = this.props.navigation.state.params.gamesList;
  var gameIconList = [];
  
  for(var i=0;i&lt;3;i++){
    var provider = gamesList[i].provider;
    var gameId = gamesList[i].gameId.toString();
  
    gameIconList.push(
      &lt;TouchableOpacity onPress={(provider,gameId) =&gt; this.launchGame(provider,gameId)}&gt;
        &lt;ResponsiveImage source={{uri: gamesList[i].imageUrl}}
        initWidth="200" initHeight="120" defaultSource={require('./splash-tile2.png')} /&gt;
      &lt;/TouchableOpacity&gt;
    );
  }
  </code></pre>
  
  <p>This is all happening within the <code>render()</code> function and the <code>{gameIconList}</code> will be called in the <code>return()</code> function as below:</p>
  
  <pre><code>return(
   &lt;ScrollView horizontal={true}&gt;
      {gameIconList}
   &lt;/ScrollView&gt;
  );
  </code></pre>
  
  <p>As you can see I am setting the string values into the onPress function call via the loop and when I click the image within the <code>TouchableOpacity</code> I want the string values I am setting to be sent back to the function above which is:</p>
  
  <pre><code>  launchGame = (provider, gameId) =&gt; {
  
    params = {
      Provider: provider.nativeEvent.text,
      Platform: this.state.Platform,
      Environment: this.state.Environment,
      GameId: gameId,
      IsDemo: this.state.IsDemo
    };
  
    request = {
      method: 'POST',
      headers:{
        "Content-Type": "application/json"
      },
      body: params
    };
  
  }
  </code></pre>
  
  <p>But the problem is I have tried so many different methods and I always end up getting a Proxy object sent back to me when it comes to the provider value and an undefined sent to me when it comes to the gameId value.</p>
  
  <p>I have tried the calling method of <code>event.target.value</code> and <code>event.nativeEvent.text</code> but to no avail.</p>
  
  <p>What am I missing?
  And if this is not the correct way of sending values to the function, can I get a guide on how to do it properly?</p>