title: How to create infinite scroll in Flatlist with Redux?
body: <p>New to ReactNative and I'm trying to use flatlist with infinite scroll. However the issue it seems to re-render the whole entire list instead of only rendering new items to the bottom of the list. How to fix it?</p>
  <pre><code>  const ActsPreviewScreen = ({ navigation }) =&gt; {
    const dispatch = useDispatch()
    const fetchActsPreview = () =&gt; dispatch(getActsPreview(page))
    const [page, setPage] = useState(1)
  
    useEffect(() =&gt; {
      console.log('requestToServer')
      fetchActsPreview(page)
    }, [])
  
    const { actsPreview } = useSelector(state =&gt; ({
      ...state.act,
      attributes: { ...state.attributes },
    }))
  
    const handleLoadMore = () =&gt; {
      setPage(page + 1)
      console.log('loadmore')
      fetchActsPreview(page)
    }
  
  return (
      &lt;View&gt;
        &lt;View&gt;
          &lt;FlatList
            data={actsPreview}
            keyExtractor={item =&gt; item.id.toString()}
            renderItem={renderItem}
            onEndReached={handleLoadMore}
            onEndReachedThreshold={0.5}
          /&gt;
        &lt;/View&gt;
      &lt;/View&gt;
    )
  </code></pre>
  <p>Act Preview is an array of Acts. API gives / acts with an array of 10 acts. Pagination is available through the &quot;? Page =&quot; parameter. / acts / {: id} gives extended information about the act. fields are both enclosed in attributes.</p>
  <p>Current State Tree:</p>
  <pre><code>▼act: {
    
    ▼act: {
    ▶attributes: {additionUrls, additions: null, city, collect: false, crime: false…}
    id: &quot;154523&quot;
    type: &quot;act&quot;
    }
    
    ▼actsPreview: [
    ▼0: {
      ▶attributes: {city, customer, date: 2021-10-15, expert: null, id: 154523…}
      id: &quot;154523&quot;
      type: &quot;act_preview&quot;
      }
    ▶1: {attributes, id: 154522, type: act_preview}
    ▶2: {attributes, id: 154521, type: act_preview}
    ▶3: {attributes, id: 154520, type: act_preview}
    ▶4: {attributes, id: 154519, type: act_preview}
    ▶5: {attributes, id: 154518, type: act_preview}
    ▶6: {attributes, id: 154517, type: act_preview}
    ▶7: {attributes, id: 154516, type: act_preview}
    ▶8: {attributes, id: 154515, type: act_preview}
    ▶9: {attributes, id: 154514, type: act_preview}
    ]
    }
  </code></pre>