Q:

How to detect top is reached on inverted react-native flat list

am designing a chat screen, in which the data is shown from bottom .  to top.  once the top is reached need to do pagination API call.  I have used a flat list for showing the data with the inverted prop.  once I reach the top of the list I have to make another call.   
I have tried to find scroll height but that is also not coming :(
<FlatList
          ref={nameRef}
          data={messages}
          renderItem={({ item }) => renderData(item)}
          inverted
          onScroll={(e) => handleScroll(e)}
        />

I need to do an API call once it reached the top of the list

A:

You can use onEndReached prop to determine the top like below:
<FlatList
      ref={nameRef}
      data={messages}
      renderItem={({item}) => renderData(item)}
      inverted
      onEndReached={this.handlePagination}
    />

