title: Refresh a Flatlist if data from function inside componentDidMount is changed
body: <p>Good day SO.</p>
  <p>I am a beginner in React Native so my terminology is very lacking. The project was inherited from previous programmer.</p>
  <p>I have an async functions</p>
  <pre><code>getData = async () =&gt; {}
  </code></pre>
  <p>Then here:</p>
  <pre><code>componentDidMount() {
  
      this.getData ();
  }
  </code></pre>
  <p>Then last is Flatlist</p>
  <pre><code>  &lt;FlatList
      data={this.state.somedata}
      renderItem{({item, index}) =&gt; {}} /&gt;
  </code></pre>
  <p>My question is, if data is changed, how should I update my flatlist? I read that I need to add extraData but I dont know what variable should I add inside.</p>
  <p>Note I know that componentDidMount only runs once on the first render. But I dont know how to proceed.</p>