title: How to make Paging in React Native using Flatlist onEndReached
body: <p>When I have an axios file like this: </p>
  
  <pre><code>  axios({
      method: 'post',
      url: ARTICLES_URL,
      headers: {
        Authorization: `Bearer ${token}`,
      },
      data: {
        header: {
          page: pages,
          size: 10,
          sort: 'DESC',
        },
        body: {},
      },
    }).then((response) =&gt; {
      if (response.data.header.response_code === '99') {
        dispatch(articleFetchSuccess(response.data));
        while(articleFetchSuccess(Response.data)) {
        }
      } else {
        dispatch(articleFetchFailed(response.data));
      }
    });
  };
  </code></pre>
  
  <p>and I have a component file like this: </p>
  
  <pre><code>&lt;div&gt;
  &lt;FlatList
              ListHeaderComponent={(
                &lt;View style={common.flatlistHeaderContainer}&gt;
                  &lt;Icon name="info-outline" size={24} color={color.colorMute} /&gt;
                  &lt;Text&gt;{` ${articleData.length} Articles Found`}&lt;/Text&gt;
                &lt;/View&gt;
  )}
              contentContainerStyle={{ paddingHorizontal: 19 }}
              data={articleData}
              renderItem={this.articleCardItem}
              keyExtractor={this.articleCardItemKey}
              onEndReached={this.handlePages}
              onEndReachedThreshold={0}
            /&gt;
  &lt;/div&gt;
  )
  }
  
  }
  </code></pre>
  
  <p>how I can to make page in axios can dynamic based on onEndReached from flatlist when axios and component in different file? I just found when axios and component in one file, but in my case, I have axios file and component file</p>
  
  <p>and this for my API response</p>
  
  <pre><code>{
      "header": {
          "response_code": "99",
          "response_description": "Success"
      },
      "body": [
          {
              "id": "63026",
              "kd_art_size": "YK800100160",
              "kd_article": "YK-8001-16",
              "sku_id": "22209",
              "size": "-",
              "nama": "STELAN",
              "unit": "PCS",
              "price": "259900",
              "jenis": "-",
              "discount": "0",
              "company_code": "ESM ",
              "user_id": "Wina09",
              "date_input": "2017-02-17 16:57:54",
              "user_update": "",
              "date_update": null,
              "link_gambar": null,
              "price_putus": null,
              "hpp": "0"
          },etc
  </code></pre>
  
  <p>I already tried all course about paging but I dont understand how to implement in my case.</p>
  
  <p>I hope I can solve this problem.</p>