title: React Native - iterating an array using map() to update this.state.variable
body: <p>I'm trying to iterate through an array and create <code>&lt;View&gt;&lt;Text&gt;this item&lt;/Text&gt;&lt;View&gt;</code> for each item in the array, add them together, and setState to a variable in order to update a list on the page.</p>
  
  <p>I'm able to iterate through the array and create simple text entries on the page for each item in the array. I'm also able to create one <code>&lt;View&gt;&lt;Text&gt;this item&lt;/Text&gt;&lt;/View&gt;</code> and update the page. However, when I try to put both together (format the text AND combine them all together), I get [object][Object] for each item.</p>
  
  <pre><code>    var schedule = getUserSchedule(this.state.apiToken).then(resp =&gt; {
          if(resp.status == 'success'){
                  if(resp.schedule[0].length&gt;0)
                  {
                      console.log('Got user scheduling entries: ', resp.schedule[0]);
                      resp.schedule[0].map((data) =&gt; {
                          var currentSchedule = this.state.userSchedule;
                          var thisEntry = &lt;View style={{width : Metrics.screenWidth - 80 , height : 35,flexDirection : 'row', alignItems : 'center', justifyContent : 'center'}}&gt;&lt;Text style={{color : 'white', fontSize : 16}}&gt; + data.key + &lt;/Text&gt;&lt;/View&gt;;
                          //var thisEntry = data.key;  (THIS WORKS)
                          var newSchedule = currentSchedule + thisEntry;
                          this.setState({
                                userSchedule:newSchedule
                              });
                      }); 
                  } else {
                      Alert.alert('Success','null');
                  }
          } else {
                  Alert.alert('Error',resp.error);
          }
      });
  </code></pre>