title: How to update a specific line when receive a new data in React-Native Flatlist
body: <p>I have a issue with FlatList, I'm setting up a values on array (This array is created inside the state) and I need to update a specific line on him, when the routine receive a new value.</p>
  
  <p>I tried to loop the state.data, validating the current line key with the key from the new value, but unsuccessful.</p>
  
  <p>Here my code:</p>
  
  <pre class="lang-js prettyprint-override"><code>import React, { PureComponent } from 'react';
  import { View, Text, FlatList, ActivityIndicator } from 'react-native';
  
  export default class App extends PureComponent {
      state = {
          data: [],
          page: 1,
          loading: false,
      };
  
      componentDidMount() {
          this.loadData();
      }
  
      loadData = () =&gt; {
          let { data, loading } = this.state;
          data.push({ id: 1,
                      name: "Robert Garcia",
                      wins: 1 // I want to update this and preserve this line
                    });
  
          loading = false;
          this.setState({ data, loading });
      }
  
      renderItem = ({ item }) =&gt; {
          return (
              &lt;View&gt;
                 &lt;Text style={{ fontWeight: 'bold' }}&gt;{item.name}&lt;/Text&gt;
                 &lt;Text&gt;{item.wins}&lt;/Text&gt;
              &lt;/View&gt;
          )
      }
  
      render() {
          return (
              &lt;FlatList
                  style={{ marginTop: 15 }}
                  data={this.state.data}
                  renderItem={this.renderItem}
                  keyExtractor={item =&gt; item.id.toString()}
                  onEndReachedThreshold={0.1}
              /&gt;
          );
      }
  </code></pre>