title: React Native sort() in Flatlist with Objects dont work
body: <p>im currently working on a school project and I need to sort the data by the Distance because the person that is at nearest. I tried to use the sort() function on the array but it wont work and I dont know why.</p>
  <pre><code> &lt;FlatList
                              data={this.state.teachers.sort((a,b) =&gt; {return a.dis - b.dis})}
                              keyExtractor={item =&gt; item.ID}
                              renderItem={({ item }) =&gt; {
                                  return &lt;View style={styles.cardDesign}&gt;
  
                                      &lt;Text style={{ fontWeight: 'bold', textTransform: 'capitalize', fontSize: 20, alignContent: &quot;center&quot;, textAlign: 'center', paddingTop: '3%' }}&gt;{item.fach}&lt;/Text&gt;
                                      &lt;Text style={{ fontSize: 18, alignItems: &quot;center&quot;, textAlign: 'center', paddingBottom: '1%' }}&gt;{item.firstname} {item.name}&lt;/Text&gt;
                                      &lt;Image  source={{ uri: item.picture}} style={{ flex: 100, resizeMode: 'contain', height: 200, width: &quot;100%&quot;, paddingBottom: '5%' }} /&gt;
                                      &lt;Text style={{ fontSize: 18, alignItems: &quot;center&quot;, textAlign: 'center', paddingBottom: '1%' }}&gt;{item.loan} € pro Stunde&lt;/Text&gt;
                                      &lt;Text style={{ fontSize: 18, alignItems: &quot;center&quot;, textAlign: 'center', paddingBottom: '3%' }}&gt;{item.distance} KM entfernt&lt;/Text&gt;
                                      &lt;View style={styles.contactButtonContainerStyle}&gt;
                                      &lt;/View&gt;
                                  &lt;/View&gt;;
  
                              }}
                          /&gt;
  </code></pre>
  <p>And here is where the Data is pushed into the array</p>
  <pre><code>this.setState({
                          teacher_lat: responseJson[i].latitude,
                      })
  
                      this.setState({
                          teacher_lon: responseJson[i].longitude,
                      })
  
                      var NotfachString = mathe + deutsch + englisch + politik + chemie + physik + &quot;&quot;;
                      var fachString = NotfachString.substring(1);
  
                      var dis = getPreciseDistance(
                          { latitude: this.state.teacher_lat, longitude: this.state.teacher_lon },
                          { latitude: this.state.latitude, longitude: this.state.longitude },
                      );
  
                      dis = dis / 1000;
  
  
                      if (responseJson[i].ID != firebase.auth().currentUser.uid) {
                          if (subjectArray.length == 1) {
                              if (teacherFachID.includes(subjectArray[0].fachID) == true) {
                                  if (this.state.entferung &gt;= dis) {
                                      var dis = dis.toFixed(1);
                                      teachersArray.push({
                                          id: responseJson[i].ID,
                                          firstname: responseJson[i].firstname,
                                          name: responseJson[i].name,
                                          email: responseJson[i].email,
                                          gender: responseJson[i].gender,
                                          fach: fachString,
                                          distance: dis,
                                          loan: responseJson[i].loan,
                                          picture: responseJson[i].picture,
                                      });
                                  }
                              }
                          }
  
                  this.setState({
                      teachers: teachersArray,
                      isVisible: false,
                  })
  
  
  </code></pre>
  <p>Thanks for everyone who can help</p>