title: Refresh Flatlist React native
body: <p>I try to reload my feed in my flatlist with refreshControl. The scroll works fine, so if I scroll down the ActivityIndicator shows. But the problem is that the flatlist doesn't updates. Can any one see why or have a another solution to reload a flatlist?</p>
  <p>This is my reload function:</p>
  <pre><code>    return new Promise(resolve =&gt; setTimeout(resolve, timeout));
      }
  
      const onRefresh = React.useCallback(() =&gt; {
          setRefreshing(true);
          props.reload()
          wait(2000).then(() =&gt; setRefreshing(false));
      }, []);
  </code></pre>
  <p>This is how I display it in my flatlist</p>
  <pre><code>     &lt;FlatList
                      refreshControl={
                          &lt;RefreshControl
                              refreshing={refreshing}
                              onRefresh={onRefresh}
                          /&gt;
                      }
                      numColumns={1}
                      horizontal={false}
                      data={filteredDataSource}
                      extraData={filteredDataSource}
                      renderItem={({ item }) =&gt;
                      {My Items here}
                      /&gt;
                   }
  
  </code></pre>
  <p>in my Action.js (redux) I have I Function called reload()</p>
  <pre><code>export function reload() {
      return ((dispatch) =&gt; {
          dispatch(clearData())
          dispatch(fetchUsersData())
          dispatch(fetchUser())
          dispatch(fetchUserPosts())
          dispatch(fetchFollowingUsersPosts())
      })
  }
  </code></pre>
  <p>Here I set my FilteredDataSource to my posts</p>
  <pre><code>    useEffect(() =&gt; {
          let posts = [];
          if (props.usersPostLoaded == props.allPosts.length) {
              for (let i = 0; i &lt; props.allPosts.length; i++) {
                  const user = props.users.find(el =&gt; el.uid === props.allPosts[i]);
                  if (user != undefined) {
                      posts = [...posts, ...user.posts]
                  }
              }
              posts.sort(function (x, y) {
                  return x.creation - y.creation
              })
  
              setPosts(posts);
              setFilteredDataSource(posts);
              setMasterDataSource(posts);
          }
      }, [props.usersPostLoaded]); 
  </code></pre>