I'm starting in mobile applications and I've had a question about how to perform a function.

in site with many pages it is possible to notice in the footer the number of pages where you want to navigate ... `<< [1] [2] [3] [4] [5] >>`

implementing this on mobile does not get cool, an alternative is to do as some app do as the 'instagram' when you arrive at the end it automatically loads a new list. How can I do that?

I am making an app where I get a json and this json comes an array of size 20, my idea is that when I arrive at the end of the app I get another 20 and so on.

How do I get a function knowing that I've reached the end of the list and add new data?
I currently use a framework

```
<ScrollView>
<View>
<FlatList>
</FlatList
</View
</ScrollView>

```

[EDIT]

```
    proximaPagina()
    {
        alert('Finale');
    }

    renderItens() {
        return (
            <FlatList
                data={this.state.movies}
                numColumns={3}
                renderItem={info => (
                    <Item
                        item={info.item}
                        isFavorite={isFavorite(this.state.myFavorites, info.item)}
                        onToggleFavorite={() => this.handleToggleFavorite(info.item)}
                        onSinopse={() => this.handleToggleSinopse(info.item)}
                    />
                )}
                onEndReachedThreshold={0.5}
                onEndReached={()=> this.proximaPagina()}
                extraData={this.state.myFavorites}
                keyExtractor={item => `${item.id}`}
            />
        );
    }

```